Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in Android O not showing view #43

Open
mohamadAliMotlagh opened this issue Jan 3, 2018 · 8 comments
Open

in Android O not showing view #43

mohamadAliMotlagh opened this issue Jan 3, 2018 · 8 comments

Comments

@mohamadAliMotlagh
Copy link

Unable to add window android.view.ViewRootImpl$W@8d54593 -- permission denied for window type 2002

@mohamadAliMotlagh mohamadAliMotlagh changed the title i got this error in Android O not showing view Jan 3, 2018
@RupeshVM
Copy link

RupeshVM commented Feb 9, 2018

I'm having same issue. I solved using

Intent myIntent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
myIntent.setData(Uri.parse("package:" + getPackageName()));
startActivityForResult(myIntent, APP_PERMISSIONS);

But still stand out window not showing for oreo.

@johnpiao305
Copy link

this library is not working in API26, API27.
how can i fix it in these versions?

@rubenmx
Copy link

rubenmx commented Jun 26, 2018

I've fixed it by downloading the sources and changing the following:

And keep in mind that the persistent notifications needs a notification channel.

@tabish075
Copy link

tabish075 commented Jun 27, 2018

Only notification is working but the Window is not showing please help

I didn't got any errors just floating window is not showing on API >= 26

@tabish075
Copy link

@rubenmx I've fixed the notification but Floating window is not showing startForegroundService is not working

@rubenmx
Copy link

rubenmx commented Jun 27, 2018

Did you change TYPE_PHONE within the StandOutLayoutParams constructor to TYPE_APPLICATION_OVERLAY for API 26+? That was the reason it wasn't showing with my code.
TYPE_PHONE is no longer supported.

@tabish075
Copy link

@rubenmx public static void show(Context context, Class<? extends StandOutWindow> cls, int id) { if (Build.VERSION.SDK_INT >= 26) { context.startForegroundService(getShowIntent(context,cls,id)); } else { context.startService(getShowIntent(context, cls, id)); } }
And this is the constructor

super(200, 200, TYPE_SYSTEM_OVERLAY, StandOutLayoutParams.FLAG_NOT_TOUCH_MODAL | StandOutLayoutParams.FLAG_WATCH_OUTSIDE_TOUCH, PixelFormat.TRANSLUCENT);

no luck :(

@tabish075
Copy link

@rubenmx my bad i was using TYPE_SYSTEM_OVERLAY instead of TYPE_APPLICATION_OVERLAY

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

No branches or pull requests

5 participants