My application requires hover window permissions,How do I use it?
error is: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.action.MANAGE_OVERLAY_PERMISSION
code:Class clazz = Settings.class;
Field field = clazz.getDeclaredField(“ACTION_MANAGE_OVERLAY_PERMISSION”);
Intent intent = new Intent(field.get((Object)null).toString());
intent.setFlags(268435456);
intent.setData(Uri.parse(“package:” + context.getPackageName()));
context.startActivity(intent);
@si5hao Define the permission in manifest.xml for SYSTEM_ALERT_WINDOW
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
my AndroidManifest.xml have
but show error:android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.action.MANAGE_OVERLAY_PERMISSION
@si5hao Add the code to try it
if (!Settings.canDrawOverlays(context)) {
Intent intent = new Intent();
intent.setAction(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
context.startActivity(intent);
}
error is: Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.action.MANAGE_OVERLAY_PERMISSION }. on line context.startActivity(intent);
I use vim3 Android 9
@si5hao Due to the setting application of vim3 have not activity(settings. action. MANAGE_ OVERLAY_ Permission).
You can sign the apk to fix it.
Manifest.xml
android:sharedUserId="android.uid.system"
...
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
If you want this key(platform.pk8 platform.x509.pem) files, give me an email and I’ll send it to you.