有没有人知道android上的应用程序管理器的包名称。我有一个方法,我想让用户直接从我的应用程序转到应用程序管理器:
public void goToApplicationManager(){
Intent startMain = this.getPackageManager().getLaunchIntentForPackage("com.android.settings.ManageApplications");
startActivity(startMain);
}
但是会抛出一个错误..我可以做com.android.settings,它会让用户进行设置,但我想将它们专门用于应用程序管理器。我的包装名称是否错误?
我的错误:
10-24 13:36:43.748: E/AndroidRuntime(31133): FATAL EXCEPTION: main
10-24 13:36:43.748: E/AndroidRuntime(31133): java.lang.NullPointerException
10-24 13:36:43.748: E/AndroidRuntime(31133): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1382)
10-24 13:36:43.748: E/AndroidRuntime(31133): at android.app.Activity.startActivityForResult(Activity.java:3190)
10-24 13:36:43.748: E/AndroidRuntime(31133): at android.app.Activity.startActivity(Activity.java:3297)
10-24 13:36:43.748: E/AndroidRuntime(31133): at com.eliddell.services_test.ServiceLauncher.goToApplicationManager(ServiceLauncher.java:101)
10-24 13:36:43.748: E/AndroidRuntime(31133): at com.eliddell.services_test.ServiceLauncher$4.onClick(ServiceLauncher.java:156)
10-24 13:36:43.748: E/AndroidRuntime(31133): at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:168)
10-24 13:36:43.748: E/AndroidRuntime(31133): at android.os.Handler.dispatchMessage(Handler.java:99)
10-24 13:36:43.748: E/AndroidRuntime(31133): at android.os.Looper.loop(Looper.java:137)
10-24 13:36:43.748: E/AndroidRuntime(31133): at android.app.ActivityThread.main(ActivityThread.java:4514)
10-24 13:36:43.748: E/AndroidRuntime(31133): at java.lang.reflect.Method.invokeNative(Native Method)
10-24 13:36:43.748: E/AndroidRuntime(31133): at java.lang.reflect.Method.invoke(Method.java:511)
10-24 13:36:43.748: E/AndroidRuntime(31133): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
10-24 13:36:43.748: E/AndroidRuntime(31133): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
10-24 13:36:43.748: E/AndroidRuntime(31133): at dalvik.system.NativeStart.main(Native Method)
答案 0 :(得分:2)
startActivity(
new Intent(android.provider.Settings.ACTION_APPLICATION_SETTINGS), 0);
答案 1 :(得分:1)