在Android中以编程方式从启动器中删除应用程序:奇怪的异常

时间:2015-03-19 15:25:35

标签: java android android-activity

我通过PackageManager禁用组件(Activity)#setComponentEnabledSetting(),

将具有从启动器中删除它的效果。

但不知何故,对于某个用户(1%用户)来说,这次活动的异常低于...

java.lang.IllegalArgumentException异常: android.content.pm.PackageManager $的NameNotFoundException:

可能需要一些时间才能从启动器中删除活动图标。

请建议......

完成堆栈跟踪..

java.lang.RuntimeException: Unable to start activity ComponentInfo{packageName/packageName.ActivityName}: java.lang.IllegalArgumentException: android.content.pm.PackageManager$NameNotFoundException: ComponentInfo{packageName/packageName.ActivityName}
   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2305)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2359)
   at android.app.ActivityThread.access$700(ActivityThread.java:165)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1326)
   at android.os.Handler.dispatchMessage(Handler.java:99)
   at android.os.Looper.loop(Looper.java:137)
   at android.app.ActivityThread.main(ActivityThread.java:5455)
   at java.lang.reflect.Method.invokeNative(Method.java)
   at java.lang.reflect.Method.invoke(Method.java:525)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
   at dalvik.system.NativeStart.main(NativeStart.java)

Caused by: java.lang.IllegalArgumentException: android.content.pm.PackageManager$NameNotFoundException: ComponentInfo{packageName/packageName.ActivityName}
   at android.support.v4.app.NavUtils.getParentActivityName(SourceFile:284)
   at android.support.v7.app.ActionBarActivityDelegateBase.onCreate(SourceFile:153)
   at android.support.v7.app.ActionBarActivity.onCreate(SourceFile:123)
   at com.jeremyfeinstein.slidingmenu.lib.app.SlidingFragmentActivity.onCreate(SourceFile:21)
   at packageName.ActivityName.onCreate(SourceFile:83)
   at android.app.Activity.performCreate(Activity.java:5372)
   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2267)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2359)
   at android.app.ActivityThread.access$700(ActivityThread.java:165)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1326)
   at android.os.Handler.dispatchMessage(Handler.java:99)
   at android.os.Looper.loop(Looper.java:137)
   at android.app.ActivityThread.main(ActivityThread.java:5455)
   at java.lang.reflect.Method.invokeNative(Method.java)
   at java.lang.reflect.Method.invoke(Method.java:525)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
   at dalvik.system.NativeStart.main(NativeStart.java)

Caused by: android.content.pm.PackageManager$NameNotFoundException: ComponentInfo{packageName/packageName.ActivityName}
   at android.app.ApplicationPackageManager.getActivityInfo(ApplicationPackageManager.java:263)
   at android.support.v4.app.NavUtils.getParentActivityName(SourceFile:301)
   at android.support.v4.app.NavUtils.getParentActivityName(SourceFile:281)
   at android.support.v7.app.ActionBarActivityDelegateBase.onCreate(SourceFile:153)
   at android.support.v7.app.ActionBarActivity.onCreate(SourceFile:123)
   at com.jeremyfeinstein.slidingmenu.lib.app.SlidingFragmentActivity.onCreate(SourceFile:21)
   at packageName.ActivityName.onCreate(SourceFile:83)
   at android.app.Activity.performCreate(Activity.java:5372)
   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2267)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2359)
   at android.app.ActivityThread.access$700(ActivityThread.java:165)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1326)
   at android.os.Handler.dispatchMessage(Handler.java:99)
   at android.os.Looper.loop(Looper.java:137)
   at android.app.ActivityThread.main(ActivityThread.java:5455)
   at java.lang.reflect.Method.invokeNative(Method.java)
   at java.lang.reflect.Method.invoke(Method.java:525)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
   at dalvik.system.NativeStart.main(NativeStart.java)

0 个答案:

没有答案