java.lang.SecurityException: Permission Denial: starting Intent {act=android.settings.USAGE_ACCESS_SETTINGS}

后端 未结 2 1425
情书的邮戳
情书的邮戳 2020-12-21 19:54

I get java.lang.SecurityException when try to startActivityForResult(intent, requestCode); with final Intent intent = new Intent(Settings.ACTION_USAGE_ACC

相关标签:
2条回答
  • 2020-12-21 20:38

    For whatever reason, Huawei left the <intent-filter> in place for this activity, but they marked it as not exported. There is no way that you can start the activity. All you can do is catch the exception and explain to the user that you cannot navigate there.

    0 讨论(0)
  • 2020-12-21 20:39

    According to android developer documentation.

    In some cases, a matching Activity may not exist, so ensure you safeguard against this.

    Link : ACTION_USAGE_ACCESS_SETTINGS

    0 讨论(0)
提交回复
热议问题