1. ImageView after recovery of bitmap
1.11
ImageView imageView1 = (ImageView) Findviewbyid (R.ID.IMAGEVIEW1);
Bitmap = Bitmapfactory.decoderesource (Getresources (), r.drawable.ic_launcher);
Imageview1.setimagebitmap (bitmap);
Bitmap.recycle ();
The contents of the ImageView1 display are empty ..., but not the exception of the ..., but not the exceptions.
1.12
ImageView imageView1 = (ImageView) Findviewbyid (R.ID.IMAGEVIEW1);
Bitmap = Bitmapfactory.decoderesource (Getresources (), r.drawable.ic_launcher);
Imageview1.setimagebitmap (bitmap);
Imageview1.setonclicklistener (New Onclicklistener () {
@Override
public void OnClick (View v) {
StartActivity (New Intent (Mainactivity.this, Twoactivity.class));
}
});
@Override
protected void OnStop () {
Super.onstop ();
System.out.println ("OnStop");
Bitmap.recycle ();
}
When the activity is now visible, the contents of the ImageView1 display are empty ..., but not the exception of the time of the day.
2.activity Pre-Death callback method
2.11 When the user presses the Back button, the method of triggering is = "Onbackpressed,onpause,onstop,ondestroy
2.12 User Finish () The method triggered by the activity is =>onpause,onstop,ondestroy
Callback method for imageview,activity before bitmap is recycled