android.content.ActivityNotFoundException:未找到 Activity 来处理 Intent { act=android.settings.USAGE_ACCESS_SETTINGS }
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.USAGE_ACCESS_SETTINGS }
此问题仅发生在 Android 5.0 Lollipop 上。我无法使用 Lollipop 访问 phone,我已经在 Genymotion Android 模拟器中开发了代码,但这个问题不会在模拟器中发生。我只从用户的 phones.
中得到失败的堆栈跟踪
我的代码:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Intent intent = new Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS);
startActivity(intent);
}
应用程序崩溃以及我从用户那里获得的堆栈跟踪信息:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.USAGE_ACCESS_SETTINGS }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1765)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1485)
at android.app.Activity.startActivityForResult(Activity.java:3780)
at android.app.Activity.startActivityForResult(Activity.java:3741)
at android.support.v4.app.FragmentActivity.startActivityFromFragment(FragmentActivity.java:849)
at android.support.v4.app.Fragment.startActivity(Fragment.java:880)
at com.myapp.myfirstapp.fragments.addablock.apps.Fragment_appsselect_addblock.onClick(Fragment_ appsselect_addblock.java:147)
at android.view.View.performClick(View.java:4763)
at android.view.View$PerformClick.run(View.java:19821)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5274)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
我也看到了这个崩溃。 LG 似乎已经从他们的 Lollipop 版本中删除了新引入的使用权限设置屏幕。
此问题仅发生在 Android 5.0 Lollipop 上。我无法使用 Lollipop 访问 phone,我已经在 Genymotion Android 模拟器中开发了代码,但这个问题不会在模拟器中发生。我只从用户的 phones.
中得到失败的堆栈跟踪我的代码:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Intent intent = new Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS);
startActivity(intent);
}
应用程序崩溃以及我从用户那里获得的堆栈跟踪信息:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.USAGE_ACCESS_SETTINGS }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1765)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1485)
at android.app.Activity.startActivityForResult(Activity.java:3780)
at android.app.Activity.startActivityForResult(Activity.java:3741)
at android.support.v4.app.FragmentActivity.startActivityFromFragment(FragmentActivity.java:849)
at android.support.v4.app.Fragment.startActivity(Fragment.java:880)
at com.myapp.myfirstapp.fragments.addablock.apps.Fragment_appsselect_addblock.onClick(Fragment_ appsselect_addblock.java:147)
at android.view.View.performClick(View.java:4763)
at android.view.View$PerformClick.run(View.java:19821)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5274)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
我也看到了这个崩溃。 LG 似乎已经从他们的 Lollipop 版本中删除了新引入的使用权限设置屏幕。