1.有时候我们的程序建立很多activity,你想关闭所有,其实这是没有必要的,至于为啥 是看见别人说的,如果你非要关闭所有 有两个方法 第一个 使用intent flag FLAG_ACTIVITY_CLEAR_TOP which brings the targeted activity to the top of the stack and closes anything else that may have been open since
他的意思是说 会保留主activity,然后关必其他的,所以你使用上面的标记之后然后finish就可以了
另一个就是startActivityForResult,这个需要你为每个activity有个反馈信息 然后受到信息关掉。
2.减少大图片占用内存的方法,最好是使用RGB_565 ,少用ARGB_8888 ,其他的尽量不用
BitmapFactory.Options options = new BitmapFactory.Options();
options.inPreferredConfig = Bitmap.Config.RGB_565;
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.icon, options);