0

有谁知道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)
4

2 回答 2

2
startActivity(
 new Intent(android.provider.Settings.ACTION_APPLICATION_SETTINGS), 0);
于 2012-10-24T17:49:39.687 回答
1

你看过ACTION_MANAGE_APPLICATIONS_SETTINGSACTION_MANAGE_ALL_APPLICATIONS_SETTINGS吗?

于 2012-10-24T17:50:01.367 回答