3

我的应用程序运行良好,但突然在模拟器中我的应用程序崩溃了,但我没有对代码进行任何更改

以供参考

04-12 09:41:05.079: W/ActivityManager(879): Activity destroy timeout for ActivityRecord{b5aaca48 com.bostonmediatech.gayatrimantra/.Main}
04-12 09:41:05.079: W/ActivityManager(879): Activity destroy timeout for ActivityRecord{b5c6ea90 com.bostonmediatech.gayatrimantra/.Home}
04-12 09:41:06.449: I/ActivityManager(879): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.bostonmediatech.gayatrimantra/.Main} from pid 1008
04-12 09:41:06.449: W/WindowManager(879): Failure taking screenshot for (180x300) to layer 21005
04-12 09:41:06.459: D/dalvikvm(1466): Not late-enabling CheckJNI (already on)
04-12 09:41:06.459: D/dalvikvm(786): GC_EXPLICIT freed 35K, 4% free 8982K/9283K, paused 0ms+4ms
04-12 09:41:06.470: D/dalvikvm(786): GC_EXPLICIT freed <1K, 4% free 8982K/9283K, paused 1ms+0ms
04-12 09:41:06.470: D/dalvikvm(786): GC_EXPLICIT freed <1K, 4% free 8982K/9283K, paused 0ms+0ms
04-12 09:41:06.470: I/ActivityManager(879): Start proc com.bostonmediatech.gayatrimantra for activity com.bostonmediatech.gayatrimantra/.Main: pid=1466 uid=10039 gids={}
04-12 09:41:06.479: W/NetworkManagementSocketTagger(879): setKernelCountSet(10039, 1) failed with errno -2
04-12 09:41:06.479: D/dalvikvm(1466): GC_FOR_ALLOC freed 67K, 3% free 9021K/9283K, paused 0ms
04-12 09:41:06.479: I/dalvikvm-heap(1466): Grow heap (frag case) to 9.450MB for 614412-byte allocation
04-12 09:41:06.509: D/dalvikvm(1466): GC_CONCURRENT freed 0K, 4% free 9621K/9927K, paused 0ms+1ms
04-12 09:41:06.571: D/gralloc_goldfish(1466): Emulator without GPU emulation detected.
04-12 09:41:06.619: I/ActivityManager(879): Displayed com.bostonmediatech.gayatrimantra/.Main: +170ms (total +12s176ms)
04-12 09:41:06.629: W/InputManagerService(879): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@b5c2dfa0 (uid=10012 pid=1008)
04-12 09:41:07.207: W/NetworkManagementSocketTagger(879): setKernelCountSet(10012, 0) failed with errno -2
04-12 09:41:07.789: W/ThrottleService(879): unable to find stats for iface rmnet0
04-12 09:41:07.789: E/ThrottleService(879): Error reading data file
04-12 09:41:08.689: I/ActivityManager(879): START {act=com.bostonmediatech.gayatrimantra.CLEARSCREEN cmp=com.bostonmediatech.gayatrimantra/.Home} from pid 1466
04-12 09:41:08.689: W/WindowManager(879): Failure taking screenshot for (180x300) to layer 21010
04-12 09:41:08.699: D/dalvikvm(1466): GC_FOR_ALLOC freed 4K, 3% free 9640K/9927K, paused 3ms
04-12 09:41:08.699: I/dalvikvm-heap(1466): Grow heap (frag case) to 10.054MB for 614412-byte allocation
04-12 09:41:08.719: D/dalvikvm(1466): GC_CONCURRENT freed <1K, 4% free 10240K/10567K, paused 0ms+0ms
04-12 09:41:08.731: D/AndroidRuntime(1466): Shutting down VM
04-12 09:41:08.731: W/dalvikvm(1466): threadid=1: thread exiting with uncaught exception (group=0xb508f180)
04-12 09:41:08.731: E/AndroidRuntime(1466): FATAL EXCEPTION: main
04-12 09:41:08.731: E/AndroidRuntime(1466): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bostonmediatech.gayatrimantra/com.bostonmediatech.gayatrimantra.Home}: android.view.InflateException: Binary XML file line #8: Error inflating class android.widget.ListView
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.app.ActivityThread.access$600(ActivityThread.java:123)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.os.Looper.loop(Looper.java:137)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.app.ActivityThread.main(ActivityThread.java:4424)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at java.lang.reflect.Method.invokeNative(Native Method)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at java.lang.reflect.Method.invoke(Method.java:511)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at dalvik.system.NativeStart.main(Native Method)
04-12 09:41:08.731: E/AndroidRuntime(1466): Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class android.widget.ListView
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.view.LayoutInflater.createView(LayoutInflater.java:606)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.view.LayoutInflater.onCreateView(LayoutInflater.java:653)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:678)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.app.Activity.setContentView(Activity.java:1835)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at com.bostonmediatech.gayatrimantra.Home.onCreate(Home.java:26)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.app.Activity.performCreate(Activity.java:4465)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
04-12 09:41:08.731: E/AndroidRuntime(1466):     ... 11 more
04-12 09:41:08.731: E/AndroidRuntime(1466): Caused by: java.lang.reflect.InvocationTargetException
04-12 09:41:08.731: E/AndroidRuntime(1466):     at java.lang.reflect.Constructor.constructNative(Native Method)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.view.LayoutInflater.createView(LayoutInflater.java:586)
04-12 09:41:08.731: E/AndroidRuntime(1466):     ... 24 more
04-12 09:41:08.731: E/AndroidRuntime(1466): Caused by: java.lang.RuntimeException: Don't call setOnClickListener for an AdapterView. You probably want setOnItemClickListener instead
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.widget.AdapterView.setOnClickListener(AdapterView.java:761)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.view.View.<init>(View.java:3018)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.view.ViewGroup.<init>(ViewGroup.java:385)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.widget.AdapterView.<init>(AdapterView.java:234)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.widget.AbsListView.<init>(AbsListView.java:734)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.widget.ListView.<init>(ListView.java:141)
04-12 09:41:08.731: E/AndroidRuntime(1466):     at android.widget.ListView.<init>(ListView.java:137)
04-12 09:41:08.731: E/AndroidRuntime(1466):     ... 27 more
04-12 09:41:08.731: W/ActivityManager(879):   Force finishing activity com.bostonmediatech.gayatrimantra/.Home
04-12 09:41:08.759: D/dalvikvm(879): GC_CONCURRENT freed 347K, 12% free 11209K/12615K, paused 0ms+1ms
04-12 09:41:09.199: I/Process(879): Sending signal. PID: 1466 SIG: 3
04-12 09:41:09.199: I/dalvikvm(1466): threadid=3: reacting to signal 3
04-12 09:41:09.199: I/dalvikvm(1466): Wrote stack traces to '/data/anr/traces.txt'
04-12 09:41:09.239: W/ActivityManager(879): Activity pause timeout for ActivityRecord{b5c736d0 com.bostonmediatech.gayatrimantra/.Home}
04-12 09:41:09.239: I/Process(879): Sending signal. PID: 1466 SIG: 3
04-12 09:41:09.239: I/dalvikvm(1466): threadid=3: reacting to signal 3
04-12 09:41:09.239: I/dalvikvm(1466): Wrote stack traces to '/data/anr/traces.txt'
04-12 09:41:09.249: W/NetworkManagementSocketTagger(879): setKernelCountSet(10012, 1) failed with errno -2
04-12 09:41:09.301: W/NetworkManagementSocketTagger(879): setKernelCountSet(10039, 0) failed with errno -2
04-12 09:41:09.323: D/dalvikvm(1008): GC_FOR_ALLOC freed 2466K, 29% free 17654K/24647K, paused 5ms
04-12 09:41:09.499: D/dalvikvm(1008): GC_CONCURRENT freed 1766K, 28% free 17895K/24647K, paused 0ms+0ms
04-12 09:41:09.529: D/dalvikvm(1008): GC_FOR_ALLOC freed 1568K, 26% free 18277K/24647K, paused 17ms
04-12 09:41:09.531: D/dalvikvm(1008): GC_CONCURRENT freed 310K, 26% free 18312K/24647K, paused 1ms+1ms
04-12 09:41:10.199: I/Process(1466): Sending signal. PID: 1466 SIG: 9
04-12 09:41:10.199: I/WindowManager(879): WIN DEATH: Window{b5be9ae0 com.bostonmediatech.gayatrimantra/com.bostonmediatech.gayatrimantra.Main paused=true}
04-12 09:41:10.199: I/ActivityManager(879): Process com.bostonmediatech.gayatrimantra (pid 1466) has died.
04-12 09:41:10.269: W/InputManagerService(879): Got RemoteException sending setActive(false) notification to pid 1466 uid 10039
04-12 09:41:19.301: W/ActivityManager(879): Activity destroy timeout for ActivityRecord{b5c0f358 com.bostonmediatech.gayatrimantra/.Main}
04-12 09:41:19.301: W/ActivityManager(879): Activity destroy timeout for ActivityRecord{b5c736d0 com.bostonmediatech.gayatrimantra/.Home}
4

2 回答 2

2

java.lang.RuntimeException:不要为 AdapterView 调用 setOnClickListener。你可能想要 setOnItemClickListener

这是例外,因为您为 ListView 设置了 onClickListener,但您应该设置 onItemClickListener。

并发布您的代码以识别其他问题。

并确保它是AdapterView.OnItemClickListener()

于 2013-04-12T04:24:20.373 回答
2

从布局中删除 onClick 或 onItemClick

于 2013-04-12T04:34:06.927 回答