Is There A Way To Check If Android Windowmanager Already Contains A View?
When I try to do a WindowManager.removeView(), E/AndroidRuntime( 2445): java.lang.IllegalArgumentException: View=android.widget.LinearLayout{41a03700 V.E..... ......I. 0,0-0,0} not
Solution 1:
You can check to see if the view's window token is null:
if(view.getWindowToken()!=null){WindowManager.removeView(view);}
You could also just catch the exception:
try{
WindowManager.removeView(view);
}catch(IllegalArgumentException e){
Log.e(debug_tag, "view not found");
}
Post a Comment for "Is There A Way To Check If Android Windowmanager Already Contains A View?"