Keeping track of View added to WindowManager (no findViewById() function?)

后端 未结 4 2087
无人及你
无人及你 2020-12-29 06:50

In my service I add a view to WindowManager with addView(). When I\'m ready to hide the view, I call removeView() using the View

4条回答
  •  既然无缘
    2020-12-29 07:12

    Check that the views parent != null before trying to remove it.

    if(mView.getParent() != null){
       wm.removeView(mView);
    }
    

提交回复
热议问题