Buggy code:
public class MainActivity extends Activity implements LocationListener , GooglePlayServicesClient . ConnectionCallbacks , GooglePlayServicesClient . OnConnectionFailedListener { DbHelper db ; ParseDb parseDb ; DbProfile dbProfile ; public static Context mainContext ; ImageView locationIcon ; ImageView saveImageIcon ; ImageView profileView ; LinearLayout armyButton ; LinearLayout fightButton ; LinearLayout historyButton ; LinearLayout profileButton ; ImageView logoutButton ; TextView locTextView ; TextView longitudeText ; TextView latitudeText ; TextView userNumberText ; LocationListener locationListener ; LocationManager locationManager ; String provider ; Criteria criteria ; Location location ; private ParseUser currentUser ; private static final int RESULT_LOAD_IMAGE = 111 ; public static PendingIntent pintent ; public static AlarmManager alarm ; public static boolean serviceOn ; private TextView txtLastKnownLoc ; private EditText etLocationInterval ; private TextView txtLocationRequest ; private LocationClient locationclient ; private LocationRequest locationrequest ; private Intent mIntentService ; private PendingIntent mPendingIntent ; Location loc ; BackgroundReceiver backgroundReceiver ; double longi ; double lati ; int numberUsers ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void startActivity ( Class activity ) { } private void createDailyChallengeEntry ( ) { } private void createAchievements ( ) { } private List < DbAchievement > setRequirements ( ) { } private void createSoldiers ( ) { } public static Context getAppContext ( ) { } public BroadcastReceiver broadcastReceiver = new BroadcastReceiver ( ) { @ Override public void onReceive ( Context context , Intent intent ) { } } ; @ Override protected void onDestroy ( ) { } @ Override public void onResume ( ) { } @ Override public void onPause ( ) { } @ Override public void onConnected ( Bundle connectionHint ) { } @ Override public void onDisconnected ( ) { } @ Override public void onConnectionFailed ( ConnectionResult result ) { } @ Override public void onLocationChanged ( Location location ) { } @ Override public void onProviderEnabled ( String provider ) { } @ Override public void onProviderDisabled ( String provider ) { } @ Override public void onStatusChanged ( String provider , int status , Bundle extras ) { } public void initDB ( ) { if ( ( parseDb . getPlayerLevel ( ) ) > 0 ) { System . out . println ( ( "parseDb.getPlayerLevel()>0<seq2seq4repair_space>TRUE:<seq2seq4repair_space>" + ( parseDb . getPlayerLevel ( ) ) ) ) ; } else { System . out . println ( ( "parseDb.getPlayerLevel()>0<seq2seq4repair_space>FALSE:<seq2seq4repair_space>" + ( parseDb . getPlayerLevel ( ) ) ) ) ; parseDb . updateArmy ( 0 , 0 , 1 , 0 ) ; } String parseUserID = ParseUser . getCurrentUser ( ) . getObjectId ( ) ; List < DbProfile > profiles = db . getAllProfiles ( ) ; if ( ( profiles . size ( ) ) == 0 ) { Log . i ( "MainActivity.initDB" , ( ( "No<seq2seq4repair_space>profiles<seq2seq4repair_space>found<seq2seq4repair_space>on<seq2seq4repair_space>device!<seq2seq4repair_space>Creating<seq2seq4repair_space>profile<seq2seq4repair_space>with<seq2seq4repair_space>ID<seq2seq4repair_space>" + parseUserID ) + "." ) ) ; dbProfile = new DbProfile ( parseDb . getUserID ( ) , parseDb . getCurrentUserName ( ) , BitmapFactory . decodeResource ( getApplicationContext ( ) . getResources ( ) , profile_placeholder ) , parseDb . getPlayerLevel ( ) , parseDb . getEP ( ) , parseDb . getArmyStrength ( ) , parseDb . getMaxLevel ( ) ) ; db . createProfile ( dbProfile ) ; if ( parseDb . existImage ( ) ) { System . out . println ( "getimage<seq2seq4repair_space>!=<seq2seq4repair_space>null<seq2seq4repair_space>-><seq2seq4repair_space>bild<seq2seq4repair_space>wird<seq2seq4repair_space>aus<seq2seq4repair_space>db<seq2seq4repair_space>genommen" ) ; dbProfile . setImg ( parseDb . getImage ( ) ) ; } } else { for ( DbProfile oneProfile : profiles ) { if ( ! ( oneProfile . getServerID ( ) . equals ( parseUserID ) ) ) { Log . i ( "MainActivity.initDB" , ( ( "Profile<seq2seq4repair_space>with<seq2seq4repair_space>ID<seq2seq4repair_space>" + parseUserID ) + "<seq2seq4repair_space>not<seq2seq4repair_space>under<seq2seq4repair_space>existing<seq2seq4repair_space>profiles.<seq2seq4repair_space>Creating<seq2seq4repair_space>it!" ) ) ; <START_BUG> dbProfile = new DbProfile ( parseDb . getUserID ( ) , parseDb . getCurrentUserName ( ) , parseDb . getPlayerLevel ( ) , parseDb . getEP ( ) , parseDb . getArmyStrength ( ) , parseDb . getMaxLevel ( ) ) ; <END_BUG> db . createProfile ( dbProfile ) ; if ( ( parseDb . getImage ( ) ) != null ) { System . out . println ( "getimage<seq2seq4repair_space>!=<seq2seq4repair_space>null<seq2seq4repair_space>-><seq2seq4repair_space>bild<seq2seq4repair_space>wird<seq2seq4repair_space>aus<seq2seq4repair_space>db<seq2seq4repair_space>genommen" ) ; dbProfile . setImg ( parseDb . getImage ( ) ) ; } } else { dbProfile = db . getProfile ( parseUserID ) ; if ( parseDb . existImage ( ) ) { System . out . println ( "getimage<seq2seq4repair_space>!=<seq2seq4repair_space>null<seq2seq4repair_space>-><seq2seq4repair_space>bild<seq2seq4repair_space>wird<seq2seq4repair_space>aus<seq2seq4repair_space>db<seq2seq4repair_space>genommen" ) ; dbProfile . setImg ( parseDb . getImage ( ) ) ; } Log . i ( "MainActivity.initDB" , ( ( "Profile<seq2seq4repair_space>with<seq2seq4repair_space>ID<seq2seq4repair_space>" + parseUserID ) + "<seq2seq4repair_space>already<seq2seq4repair_space>existing" ) ) ; } } } System . out . println ( "#################<seq2seq4repair_space>Profile<seq2seq4repair_space>logged<seq2seq4repair_space>#################" ) ; } public void getTheLastLocation ( ) { } public void startLocationIntent ( ) { } public void stopLocationIntent ( ) { } public void setLocText ( Location location ) { } public void setLocWithReceiver ( ) { } }

Fix:
dbProfile = new DbProfile ( parseDb . getUserID ( ) , parseDb . getCurrentUserName ( ) , BitmapFactory . decodeResource ( getApplicationContext ( ) . getResources ( ) , profile_placeholder ) , parseDb . getPlayerLevel ( ) , parseDb . getEP ( ) , parseDb . getArmyStrength ( ) , parseDb . getMaxLevel ( ) ) ;