我正在开发一个相当普通的资源使用应用程序(在Galaxy S3上大约19-22 MB,所以它绝对可以处理它),其中一个“功能”是显示联系人的信息,通过使用下一个代码:
public static Intent createIntentForContact(final String contactKey) {
final Intent intent = new Intent(Intent.ACTION_VIEW);
final Uri uri = Uri.withAppendedPath(Contacts.CONTENT_LOOKUP_URI, contactKey);
intent.setData(uri);
return intent;
}
...
startActivity(createIntentForContact(...)) ;
只要我留在应用程序上,一切正常。
但是,如果我在应用程序显示设备联系人信息时按住主页,然后返回应用程序,然后按回来,应用程序将自动重启。
我已经在一个全新的项目中测试了这个代码,但它在那里工作得非常好。我也在Galaxy S2上测试过它,它在那里工作得很好。我已经在设置中检查了开发人员类别,并且没有任何特殊内容。
怎么会发生这样的事情? 该应用程序没有太多的内存,所以为什么它关闭,为什么它不与联系信息屏幕一起关闭(因为我没有添加任何标志)?
01-07 11:40:00.610:W
/nalizableReferenceQueue(6856): Could not load Finalizer in its own class loader. Loading Finalizer in the current class loader instead. As a result, you will not be able to garbage collect this class loader. To support reclaiming this class loader, either resolve the underlying issue, or move Google Collections to your system class path.
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): java.io.FileNotFoundException: com/google/inject/internal/util/$Finalizer.class
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.internal.util.$FinalizableReferenceQueue$DecoupledLoader.getBaseUrl(FinalizableReferenceQueue.java:269)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.internal.util.$FinalizableReferenceQueue$DecoupledLoader.loadFinalizer(FinalizableReferenceQueue.java:253)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.internal.util.$FinalizableReferenceQueue.loadFinalizer(FinalizableReferenceQueue.java:175)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.internal.util.$FinalizableReferenceQueue.<clinit>(FinalizableReferenceQueue.java:100)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.internal.util.$MapMaker$QueueHolder.<clinit>(MapMaker.java:787)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.internal.util.$MapMaker$WeakEntry.<init>(MapMaker.java:946)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.internal.util.$MapMaker$Strength$1.newEntry(MapMaker.java:312)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.internal.util.$MapMaker$StrategyImpl.newEntry(MapMaker.java:498)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.internal.util.$MapMaker$StrategyImpl.newEntry(MapMaker.java:419)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.internal.util.$CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2029)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.internal.Annotations$AnnotationChecker.hasAnnotations(Annotations.java:116)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.internal.Annotations.isBindingAnnotation(Annotations.java:180)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.Key.ensureIsBindingAnnotation(Key.java:366)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.Key.strategyFor(Key.java:338)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.Key.get(Key.java:272)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.internal.AbstractBindingBuilder.annotatedWithInternal(AbstractBindingBuilder.java:82)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.internal.ConstantBindingBuilderImpl.annotatedWith(ConstantBindingBuilderImpl.java:49)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at roboguice.config.DefaultRoboModule.configure(DefaultRoboModule.java:117)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.AbstractModule.configure(AbstractModule.java:59)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.spi.Elements.getElements(Elements.java:101)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.google.inject.spi.Elements.getElements(Elements.java:78)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at roboguice.RoboGuice.setBaseApplicationInjector(RoboGuice.java:83)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at roboguice.RoboGuice.setBaseApplicationInjector(RoboGuice.java:139)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.syncme.modules.SyncMEApplication.onCreate(SyncMEApplication.java:41)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1003)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4228)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at android.app.ActivityThread.access$1300(ActivityThread.java:140)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1287)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at android.os.Handler.dispatchMessage(Handler.java:99)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at android.os.Looper.loop(Looper.java:137)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at android.app.ActivityThread.main(ActivityThread.java:4898)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at java.lang.reflect.Method.invokeNative(Native Method)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at java.lang.reflect.Method.invoke(Method.java:511)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
01-07 11:40:00.610: W/nalizableReferenceQueue(6856): at dalvik.system.NativeStart.main(Native Method)