使用LogCat时,日志会显示三次。任何人都可以解释为什么会这样吗? 日志样本:
04-24 15:45:30.443: INFO/dalvikvm(351): Debugger has detached; object registry had 1 entries
04-24 15:45:30.434: DEBUG/jdwp(351): JDWP shutting down net...
04-24 15:45:30.443: INFO/dalvikvm(351): Debugger has detached; object registry had 1 entries
04-24 15:45:30.482: DEBUG/dalvikvm(351): VM cleaning up
04-24 15:45:30.503: ERROR/AndroidRuntime(351): ERROR: thread attach failed
04-24 15:45:30.482: DEBUG/dalvikvm(351): VM cleaning up
04-24 15:45:30.503: ERROR/AndroidRuntime(351): ERROR: thread attach failed
04-24 15:45:30.482: DEBUG/dalvikvm(351): VM cleaning up
04-24 15:45:30.503: ERROR/AndroidRuntime(351): ERROR: thread attach failed
04-24 15:45:30.973: DEBUG/dalvikvm(351): LinearAlloc 0x0 used 638428 of 5242880 (12%)
04-24 15:45:30.973: DEBUG/dalvikvm(351): LinearAlloc 0x0 used 638428 of 5242880 (12%)
04-24 15:45:30.973: DEBUG/dalvikvm(351): LinearAlloc 0x0 used 638428 of 5242880 (12%)
04-24 15:45:31.202: INFO/ActivityManager(59): Start proc com.nuktu.menu.sample for activity com.nuktu.menu.sample/.main: pid=358 uid=10041 gids={}
04-24 15:45:31.202: INFO/ActivityManager(59): Start proc com.nuktu.menu.sample for activity com.nuktu.menu.sample/.main: pid=358 uid=10041 gids={}
04-24 15:45:31.202: INFO/ActivityManager(59): Start proc com.nuktu.menu.sample for activity com.nuktu.menu.sample/.main: pid=358 uid=10041 gids={}
04-24 15:45:31.952: DEBUG/ddm-heap(358): Got feature list request
04-24 15:45:31.952: DEBUG/ddm-heap(358): Got feature list request
04-24 15:45:31.952: DEBUG/ddm-heap(358): Got feature list request
04-24 15:45:33.922: DEBUG/dalvikvm(233): GC freed 42 objects / 2000 bytes in 6457ms
04-24 15:45:33.922: DEBUG/dalvikvm(233): GC freed 42 objects / 2000 bytes in 6457ms
04-24 15:45:33.922: DEBUG/dalvikvm(233): GC freed 42 objects / 2000 bytes in 6457ms
04-24 15:45:34.953: INFO/ActivityManager(59): Displayed activity com.nuktu.menu.sample/.main: 4650 ms (total 4650 ms)
04-24 15:45:34.953: INFO/ActivityManager(59): Displayed activity com.nuktu.menu.sample/.main: 4650 ms (total 4650 ms)
04-24 15:45:34.953: INFO/ActivityManager(59): Displayed activity com.nuktu.menu.sample/.main: 4650 ms (total 4650 ms)
04-24 15:45:37.472: INFO/ActivityManager(59): Starting activity: Intent { cmp=com.nuktu.menu.sample/.NumTest }
04-24 15:45:37.472: INFO/ActivityManager(59): Starting activity: Intent { cmp=com.nuktu.menu.sample/.NumTest }
04-24 15:45:37.472: INFO/ActivityManager(59): Starting activity: Intent { cmp=com.nuktu.menu.sample/.NumTest }
04-24 15:45:37.932: VERBOSE/TAG(358): Oncreate method
04-24 15:45:37.932: VERBOSE/TAG(358): Oncreate method
04-24 15:45:37.962: VERBOSE/TAG(358): library set to null in oncreate
04-24 15:45:37.973: VERBOSE/TAG(358): define new image
04-24 15:45:37.983: VERBOSE/TAG(358): random number gotten
04-24 15:45:38.002: VERBOSE/TAG(358): ran_num 9
04-24 15:45:37.962: VERBOSE/TAG(358): library set to null in oncreate
04-24 15:45:37.973: VERBOSE/TAG(358): define new image
04-24 15:45:37.983: VERBOSE/TAG(358): random number gotten
04-24 15:45:38.002: VERBOSE/TAG(358): ran_num 9
04-24 15:45:37.932: VERBOSE/TAG(358): Oncreate method
04-24 15:45:37.962: VERBOSE/TAG(358): library set to null in oncreate
答案 0 :(得分:5)
这件事发生在我身上几次。尝试重置DDMS(它是Eclipse中的隐藏选项,查找“屏幕截图”按钮旁边的向下箭头)。
答案 1 :(得分:0)
如果您正在使用Timber之类的日志记录库,请检查CustomApplication类。 您可能会多次初始化库,例如:
public class CustomApplication extends Application {
@Override public void onCreate() {
super.onCreate();
if (BuildConfig.DEBUG) {
Timber.plant(new DebugTree());
Timber.plant(new DebugTree());
}
}
}