
No matter what TYPE I use for the LayoutParams, I always get this crash. The method removeViewImmediate() has the following parameter. You can vote up the ones you like or vote down the ones you dont like, and go to the original project or source file by following the links above each example. avity = Gravity.TOP | Gravity.START Įxception stacktrace: Caused by: $BadTokenException: Unable to add window - token null is not valid is your activity running?Īt (ViewRootImpl.java:764Īt (WindowManagerGlobal.java:356)Īt (WindowManagerImpl.java:92) RelativeLayout overlay = (RelativeLayout) inflater.inflate(R.layout.button_main, null) įinal WindowManager.LayoutParams params = AddView(View, ViewGroup+LayoutParams) Assign the passed LayoutParams to the passed View and add the view to the window. The method removeViewImmediate() has the following parameter. LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE)


(WindowManagerGlobal.java:430) at android.view.

Public class DownWindowManager implements View.OnClickListener else if (DownloaderManager.getInstance().isDownloading(this.I'm trying to create an overlay window but when I try to add the view to the WindowManager, it gives me an exception. Android - WindowManager causing crash with 'window count is over max 300'. WindowManager.getDefaultDisplay Code Index Add Tabnine to your IDE (free) How to use getDefaultDisplay method in Best Java code snippets using android.view.
