Skip to content
This repository has been archived by the owner on Jun 30, 2024. It is now read-only.

API 28 Exception: Unable to add window -- token null is not valid; #123

Open
1371030 opened this issue Sep 26, 2018 · 5 comments
Open

API 28 Exception: Unable to add window -- token null is not valid; #123

1371030 opened this issue Sep 26, 2018 · 5 comments

Comments

@1371030
Copy link

1371030 commented Sep 26, 2018

API 28 Exception: Unable to add window -- token null is not valid; is your activity running?

@ghost
Copy link

ghost commented Dec 21, 2018

Hello, I got the same problem[

@HEZI0427
Copy link

HEZI0427 commented Feb 1, 2019

API 28 Exception: Unable to add window -- token null is not valid; is your activity running?

Step 1 : replace SuperToast WindowManager.LayoutParams.TYPE_TOAST by WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY

Step 2 : request android.permission.SYSTEM_ALERT_WINDOW permission runtime
if (Build.VERSION.SDK_INT >= 23) { if (!Settings.canDrawOverlays(getApplicationContext())) { Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + getPackageName())); startActivityForResult(intent, 10); return; } }

@Dovar66
Copy link

Dovar66 commented Feb 14, 2019

you can refer to https://github.com/Dovar66/DToast

@Behrouz-m
Copy link

use this + overlay permission

(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ?
							 WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY :
							 WindowManager.LayoutParams.TYPE_PHONE)

@fatemi2020
Copy link

Salam,
In my case, the issue was resolved after replace SuperToast with SuperActivityToast

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants