1.回收bitmap后的ImageView
1.11
ImageView imageView1 = (ImageView)findViewById(R.id.imageView1);
bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
imageView1.setImageBitmap(bitmap);
bitmap.recycle();
imageView1 显示的内容为空........................,但不会抛异常
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();
}
当前activity再可见的时候,imageView1 显示的内容为空........................,但不会抛异常
2.activity死前的回调方法
2.11用户按后退键的时候触发的方法有=》onBackPressed,onPause,onStop,onDestroy
2.12 用户finish()该activity的时候触发的方法有=>onPause,onStop,onDestroy