Error reporting when removing floating box in destroy

  android, question

This is the error message android.view.windowsaved: activitycom.example.ce.mainactivityhassaved windowandroid.widget.imageview {50f36bfv.ed ….. 0,0-144,144} that was originally added here.

The following is the floating frame code

@Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);
 button = (Button) findViewById(R.id.button1);
 button.setOnClickListener(new OnClickListener() {
 
 @Override
 public void onClick(View v) {
 // TODO Auto-generated method stub
 finish();
 
 bracket
 });
 
 display = getWindowManager().getDefaultDisplay();
 width = display.getWidth();
 height = display.getHeight();
 wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
 image = new ImageView(getBaseContext());
 image.setBackgroundResource(R.drawable.ic_launcher);
 
 mparams = new WindowManager.LayoutParams();
 mparams.width = WindowManager.LayoutParams.WRAP_CONTENT;
 mparams.height = WindowManager.LayoutParams.WRAP_CONTENT;
 mparams.type = WindowManager.LayoutParams.TYPE_PHONE;
 mparams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
 mparams.gravity = PixelFormat.RGBA_8888;
 mparams.gravity = Gravity.TOP | Gravity.LEFT;
 mparams.x = (int) (width/2);
 mparams.y = (int) (height/2);
 wm.addView(image, mparams);
 
 bracket
 
 public boolean remove(){
 wm.removeView(image);
 return true;
 bracket
 @Override
 protected void onDestroy() {
 // TODO Auto-generated method stub
 if (isFinishing()) {
 Log.i("TETS", "remove");
 remove();
 Log.i("TEST", "after remove");
 }else{
 Log.i("TEST", "activity is close");
 bracket
 super.onDestroy();
 
 bracket

The log that was typed is the one from remove and also the one from after remove. Then there is an error message. What is this? I will not make this error when I call remove in stop. Only when I call remove in destroy will there be an error. How should I solve it?

Activity was sold out when ondestory, but ImageView was not cancelled.
You try to set ImageView to null, there is no environment that can help you try it.