When application is in background and screen is locked,I'm unable to start activity, there is no exception or warning, onCreate() is just not called. I've been struggling against this problem for while, and I think I've finally found the source of it. There is a line in logs:
D/com.android.server.am.ExtraActivityManagerService: MIUILOG- Permission Denied Activity KeyguardLocked: Intent { flg=0x14010000 cmp=com.trueconf.videochat/com.trueconf.gui.activities.Call (has extras) } pkg : com.trueconf.videochat uid : 10634
Is this why I can't start an activity? Also, how do I solve this, should I disable keyguard or something?
This is a special permission on MIUI that has to be enabled for apps.
You can find it in
User must enable this manually. As far as I know, the best you can do is to guide the user to this settings menu directly by launching an intent (and probably showing some explainer text prior to this).
Intent looks like this
startActivity(new Intent("miui.intent.action.APP_PERM_EDITOR").putExtra("extra_pkgname", getPackageName()))
Make sure to try catch it as it can throw exceptions if activity can't be started (e.g. the device actually is not running MIUI or the intent is somehow not valid on the particular device/version)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With