0

我正在开发一个相当正常的资源使用应用程序(在 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 上对其进行了测试,它在那里也运行良好。我已经检查了设置中的开发人员类别,并没有勾选任何特别之处。

怎么会发生这样的事情?该应用程序不占用太多内存,为什么它被关闭了,为什么它没有与联系信息屏幕一起关闭(因为我没有为它添加任何标志)?


编辑:我在日志中注意到,有一些与 roboguice 相关的日志,这可能是导致此问题的原因。以下是日志:

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)
4

0 回答 0