zhaozepeng / floatwindowpermission Goto Github PK
View Code? Open in Web Editor NEWthis repository is aimed to adapt android float window permission in most kinds of mobiles and how to request it at runtime
this repository is aimed to adapt android float window permission in most kinds of mobiles and how to request it at runtime
现在设想的解决方案是,在后台的时候,先打开一个一像素的 activity ,然后再去开启悬浮窗,然后关闭 activity
想在自己的项目中当作工具类使用,如果可以的话十分感谢
不是问题,我只是想说我太爱你了
The first line of this repository is written as, "this repository is aimed to adapt android float window permission in most of phone models and how to request it at runtime"
This sentence is written in passive voice and should be written in active voice as per the grammatical guidelines of writing.
Secondly, the first letter of the sentence should be upper case letter.
Thirdly, the superlative degree should be used with 'the'.
So, the corrected sentence could be written as:
"This repository aims to adapt android float window permission in most of the phone models and how to request it at runtime."
Thank you.
经反馈,miui 8.1 /android 6.0 跳转页面为设置页面,不是悬浮窗权限开启页面,在此记录一下
在service中弹出dialog的时候去检测悬浮窗是否开启,然后点击返回的时候怎么获取这个状态?
场景:一个用户在其它手机登录的时候,service会发一个状态给手机,告知这个用户在其它设备已经登录,但是在弹出窗口的时候悬浮窗没有开启,然后引导用户进行设置,返回的时候这个悬浮窗的状态怎么获取?
I haven request canDrawOverlay other app but Xaomi security has other permission in my app so I want to request Display pop-up windows while running in background
and want to access state does it grant or deny
待处理
华为荣耀8 青春版 权限给了 提示窗没有消失
问题机型: 小米 红米NOTE 1S . Android4.2系统 (Api 17)。
问题描述: 自带悬浮窗管理权限。在悬浮窗管理中关闭悬浮窗权限,则悬浮窗不可用,但权限检测通过
博主:
你好,您这个试过在vivo和步步高手机上面需要申请权限的吗?
经过测试,在基于安卓6.0的MIUI9上可以正常显示悬浮窗,在基于安卓7.0的MIUI9上却无法显示(即时打开了悬浮窗权限)。请问为什么会这样呢?
华为荣耀v8最新的7.0系统上,明明应用的悬浮窗权限没有给,但是依旧能打开type为TYPE_SYSTEM_ALERT的悬浮窗。
而且您的FloatWindowManager似乎也未能跳到悬浮窗管理页面(应该说跳转的位置不够合理)。希望能看看
手机:8681-M02 系统:5.1
问题:点击去开启以后报错
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.settings/com.android.settings.Settings$OverlaySettingsActivity}; have you declared this activity in your AndroidManifest.xml?
at com.geely.g_assistant.utils.permission.rom.QikuUtils.applyPermission(QikuUtils.java:55)
at com.geely.g_assistant.utils.permission.FloatWindowManager$1.confirmResult(FloatWindowManager.java:133)
at com.geely.g_assistant.utils.permission.FloatWindowManager$6.onClick(FloatWindowManager.java:218)
at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:174)
如题,startActivityForResult 后 会造成onActivity无法响应
MIUI10.2.无法开启悬浮窗权限
如何让悬浮窗只在应用内显示???回到桌面的时候不显示。
就像这个库一样
https://github.com/yhaolpz/FloatWindow
可以这样子操作
dependencies {
compile 'com.github.yhaolpz:FloatWindow:1.0.9'
}
建议: 将代码抽取成一个类库
待处理
我看了下你的代码6.0以上系统魅族你没有用通用的跳转方法,而是用了6.0以下的跳转方法,下面是日志:
https://github.com/zhaozepeng/FloatWindowPermission/blob/master/FloatWindowPermission/app/src/main/java/com/android/permission/FloatWindowManager.java
当build.gradle中的compileSdkVersion和targetSdkVersion设置为26以上时,运行项目工程,允许悬浮窗权限之后,在单击显示悬浮窗按键应用就会崩溃。崩溃代码:
04-17 11:07:29.615 4476-4476/com.android.floatwindowpermission E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.android.floatwindowpermission, PID: 4476
android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@92c763a -- permission denied for window type 2010
at android.view.ViewRootImpl.setView(ViewRootImpl.java:905)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:369)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:128)
at com.android.permission.FloatWindowManager.showWindow(FloatWindowManager.java:313)
at com.android.permission.FloatWindowManager.applyOrShowFloatWindow(FloatWindowManager.java:61)
at com.android.floatwindowpermission.FloatWindowActivity$1.onClick(FloatWindowActivity.java:29)
at android.view.View.performClick(View.java:6291)
at android.view.View$PerformClick.run(View.java:24931)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:101)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7415)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)`
问题产生原因是:TYPE_SYSTEM_ERROR或者TYPE_TOAST在android 26被废弃,新增TYPE_APPLICATION_OVERLAY。
具体解决代码:
int mType; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { mType = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY; } else { mType = WindowManager.LayoutParams.TYPE_SYSTEM_ERROR; } mParams.type = mType;
进去手机i管家里面关闭浮框权限,在app里面可以悬浮,回到桌面上就没了
经测试。发现 Android 7.1.1 及以后 对于 Toast 的 show 方法 加入了 IBinder token 限制。如果 targetSdkVersion 大于 25。会导致Toast 校验 token,从而引发 崩溃。如果 targetSdkVersion 小于 26。经测试可以在所有android 版本正常弹出Toast(可绕过通知权限)。
如果能构造一个 合法的 IBinder token 就完美了。束手无策求大神完善
博主:
你好,请问怎么能像其他第三方sdk渠道一样,不需要用户手动去申请权限!直接就获得权限!
您的这边博客能不能抽个时间完善一下!
万分感谢
vivo X21A,应用在前台可以显示悬浮窗,当应用在后台,悬浮窗就消失了。需要进入到手机权限管理,手动打开应用的悬浮窗权限,应用在后台才能显示悬浮窗。有办法解决吗?
无论是否在i管家里面开启关闭悬浮框权限,代码检测都是打开了权限的
Miui 8.0.4.0 是 com.miui.permcenter.permissions.AppPermissionsEditorActivity
Miui 8.6.x 是 com.miui.permcenter.permissions.PermissionsEditorActivity
不知道是哪个版本开始改变的
申请完权限之后,悬浮窗不会立即显示到Activity上,需要重新再进一次Activity,按钮才会显示。
真的是良心开源者,赞赞赞!
can't open permission page with particular name, please use "adb shell dumpsys activity" command and tell me the name of the float window permission page
一加8t机型悬浮权限可以做个适配吗大佬?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.