Android: permission denied for window type 2038 using TYPE_APPLICATION_OVERLAY -


i trying create view above other applications:

windowmanager.layoutparams paramsdirectorview = new windowmanager.layoutparams(         windowmanager.layoutparams.wrap_content,         windowmanager.layoutparams.wrap_content,         windowmanager.layoutparams.type_application_overlay,         windowmanager.layoutparams.flag_not_focusable,         pixelformat.translucent); 

i have looked in other responses , found following things "drawing on applications":

  • i have android.permission.system_alert_window in manifest
  • i doing settings.candrawoverlays(this) check which comes true.
  • i have done located here permission denied window type

i still getting "-- permission denied window type 2038" error. of using type_phone , works, deprecated , says use type_application_overlay. can 1 follow on type_phone answer not resolution "patch work" solution deprecated in android o.

i running on android 7.1.2

android.view.windowmanager$badtokenexception: unable add window android.view.viewrootimpl$w@1f47e89 -- permission denied window type 2038 @ android.app.activitythread.handleserviceargs(activitythread.java:3344) @ android.app.activitythread.-wrap21(activitythread.java) @ android.app.activitythread$h.handlemessage(activitythread.java:1583) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:154) @ android.app.activitythread.main(activitythread.java:6121) @ java.lang.reflect.method.invoke(native method) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:889) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:779) caused by: android.view.windowmanager$badtokenexception: unable add window android.view.viewrootimpl$w@1f47e89 -- permission denied window type 2038 @ android.view.viewrootimpl.setview(viewrootimpl.java:703) @ android.view.windowmanagerglobal.addview(windowmanagerglobal.java:342) @ android.view.windowmanagerimpl.addview(windowmanagerimpl.java:93) @ headservice.twoviewmanager.(twoviewmanager.java:99) @ headservice.uiheadservice.onstartcommand(uiheadservice.java:65) @ android.app.activitythread.handleserviceargs(activitythread.java:3327) @ android.app.activitythread.-wrap21(activitythread.java) @ android.app.activitythread$h.handlemessage(activitythread.java:1583) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:154) @ android.app.activitythread.main(activitythread.java:6121) @ java.lang.reflect.method.invoke(native method) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:889) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:779)

try change windowmanager.layoutparams.type_application_overlay windowmanager.layoutparams.type_phone?


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -