Buggy code:
public class EditProfile extends AppCompatActivity { @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_edit_profile ) ; Toolbar toolbar = ( ( Toolbar ) ( findViewById ( toolbar ) ) ) ; setSupportActionBar ( toolbar ) ; setupActionBar ( ) ; Button saveButton = ( ( Button ) ( findViewById ( startID ) ) ) ; Button cancelButton = ( ( Button ) ( findViewById ( cancelId ) ) ) ; saveButton . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { goHome ( v ) ; } } ) ; cancelButton . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { goHome ( v ) ; } } ) ; <START_BUG> Bitmap bm = BitmapFactory . decodeResource ( getResources ( ) , profile_pic_default ) ; <END_BUG> ImageView myImageView = ( ( ImageView ) ( findViewById ( imageView4 ) ) ) ; myImageView . setImageBitmap ( bm ) ; Spinner s = ( ( Spinner ) ( findViewById ( spin ) ) ) ; ArrayAdapter adapter = ArrayAdapter . createFromResource ( this , Profile_Types , spinner_item ) ; adapter . setDropDownViewResource ( spinner_dropdown_item ) ; s . setAdapter ( adapter ) ; s . setOnItemSelectedListener ( new AdapterView . OnItemSelectedListener ( ) { @ Override public void onItemSelected ( AdapterView < ? > parent , View view , int position , long id ) { String Task = parent . getSelectedItem ( ) . toString ( ) ; Bitmap nbm = BitmapFactory . decodeResource ( getResources ( ) , selecticon ) ; ImageView superManImageView = ( ( ImageView ) ( findViewById ( imageView4 ) ) ) ; superManImageView . setImageBitmap ( nbm ) ; switch ( Task ) { case "Select<seq2seq4repair_space>Pic" : Bitmap selectbm = BitmapFactory . decodeResource ( getResources ( ) , selecticon ) ; ImageView selectImageView = ( ( ImageView ) ( findViewById ( imageView4 ) ) ) ; selectImageView . setImageBitmap ( selectbm ) ; break ; case "Superman" : Bitmap laundrybm = BitmapFactory . decodeResource ( getResources ( ) , supermanprofile ) ; ImageView laundryImageView = ( ( ImageView ) ( findViewById ( imageView4 ) ) ) ; laundryImageView . setImageBitmap ( laundrybm ) ; break ; case "WonderWoman" : Bitmap dishesbm = BitmapFactory . decodeResource ( getResources ( ) , supergirlprofile ) ; ImageView dishesImageView = ( ( ImageView ) ( findViewById ( imageView4 ) ) ) ; dishesImageView . setImageBitmap ( dishesbm ) ; break ; case "Harlequin" : Bitmap carbm = BitmapFactory . decodeResource ( getResources ( ) , harlequin_profile ) ; ImageView carImageView = ( ( ImageView ) ( findViewById ( imageView4 ) ) ) ; carImageView . setImageBitmap ( carbm ) ; break ; case "StormTrooper" : Bitmap foodbm = BitmapFactory . decodeResource ( getResources ( ) , stormtrooperprofile ) ; ImageView foodImageView = ( ( ImageView ) ( findViewById ( imageView4 ) ) ) ; foodImageView . setImageBitmap ( foodbm ) ; break ; case "Batman" : Bitmap gamebm = BitmapFactory . decodeResource ( getResources ( ) , batmanprofile ) ; ImageView gameImageView = ( ( ImageView ) ( findViewById ( imageView4 ) ) ) ; gameImageView . setImageBitmap ( gamebm ) ; break ; } } @ Override public void onNothingSelected ( AdapterView < ? > parent ) { } } ) ; } private void setupActionBar ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void goHome ( View view ) { } }

Fix:
Bitmap bm = BitmapFactory . decodeResource ( getResources ( ) , selecticon ) ;