当我在模拟器中运行它时,我的应用程序运行时没有错误并且具有预期的结果。我在我的应用程序中使用数据库。我已将数据库复制到资产文件夹中,并且在模拟器中一切正常。现在,当我尝试在移动设备上运行我的应用程序时,它会安装应用程序并显示第一个活动。但是,当移动上下文中存在数据库活动时(例如在我的应用程序中,用户输入名称并将表中的相应行显示给用户),应用程序会遇到强制关闭。这是什么原因??
编辑:包括 logcat
11-01 02:46:04.554: D/dalvikvm(1122): GC_CONCURRENT freed 94K, 18% free 469K/568K, paused 1ms+1ms, total 38ms
11-01 02:46:04.560: D/dalvikvm(1122): Debugger has detached; object registry had 1 entries
11-01 02:46:05.720: D/AndroidRuntime(1134): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
11-01 02:46:05.720: D/AndroidRuntime(1134): CheckJNI is ON
11-01 02:46:05.840: D/dalvikvm(1134): Trying to load lib libjavacore.so 0x0
11-01 02:46:05.870: D/dalvikvm(1134): Added shared lib libjavacore.so 0x0
11-01 02:46:05.950: D/dalvikvm(1134): Trying to load lib libnativehelper.so 0x0
11-01 02:46:05.950: D/dalvikvm(1134): Added shared lib libnativehelper.so 0x0
11-01 02:46:07.740: D/AndroidRuntime(1134): Calling main entry com.android.commands.am.Am
11-01 02:46:07.780: D/dalvikvm(1134): Note: class Landroid/app/ActivityManagerNative; has 157 unimplemented (abstract) methods
11-01 02:46:07.850: I/ActivityManager(308): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.ast/.Ast} from pid 1134
11-01 02:46:07.884: W/WindowManager(308): Failure taking screenshot for (328x583) to layer 21005
11-01 02:46:07.990: D/AndroidRuntime(1134): Shutting down VM
11-01 02:46:08.060: D/dalvikvm(1134): GC_CONCURRENT freed 95K, 17% free 499K/596K, paused 2ms+2ms, total 66ms
11-01 02:46:08.060: D/jdwp(1134): Got wake-up signal, bailing out of select
11-01 02:46:08.060: D/dalvikvm(1134): Debugger has detached; object registry had 1 entries
11-01 02:46:08.940: I/Choreographer(308): Skipped 31 frames! The application may be doing too much work on its main thread.
11-01 02:46:09.010: E/SurfaceFlinger(37): ro.sf.lcd_density must be defined as a build property
11-01 02:46:09.341: D/dalvikvm(958): GC_CONCURRENT freed 352K, 8% free 6071K/6544K, paused 8ms+431ms, total 1119ms
11-01 02:46:09.730: I/Choreographer(308): Skipped 78 frames! The application may be doing too much work on its main thread.
11-01 02:46:10.420: I/Choreographer(308): Skipped 68 frames! The application may be doing too much work on its main thread.
11-01 02:46:11.620: D/dalvikvm(958): GC_FOR_ALLOC freed 3477K, 55% free 3351K/7296K, paused 85ms, total 88ms
11-01 02:46:11.630: I/dalvikvm-heap(958): Grow heap (frag case) to 4.646MB for 1322740-byte allocation
11-01 02:46:11.750: D/dalvikvm(958): GC_FOR_ALLOC freed 1K, 37% free 4641K/7296K, paused 102ms, total 102ms
11-01 02:46:11.930: D/dalvikvm(958): GC_CONCURRENT freed 0K, 37% free 4641K/7296K, paused 23ms+8ms, total 179ms
11-01 02:46:12.480: E/SurfaceFlinger(37): ro.sf.lcd_density must be defined as a build property
11-01 02:46:13.240: I/ActivityManager(308): Displayed com.example.ast/.Ast: +5s275ms
11-01 02:46:30.347: D/ExchangeService(701): Received deviceId from Email app: null
11-01 02:46:30.347: D/ExchangeService(701): !!! deviceId unknown; stopping self and retrying
11-01 02:46:35.440: D/ExchangeService(701): !!! EAS ExchangeService, onCreate
11-01 02:46:35.460: D/ExchangeService(701): !!! EAS ExchangeService, onStartCommand, startingUp = false, running = false
11-01 02:46:35.499: D/ExchangeService(701): !!! EAS ExchangeService, onStartCommand, startingUp = true, running = false
11-01 02:46:35.510: W/ActivityManager(308): Unable to start service Intent { act=com.android.email.ACCOUNT_INTENT } U=0: not found
11-01 02:46:35.520: D/ExchangeService(701): !!! Email application not found; stopping self
11-01 02:46:35.570: W/ActivityManager(308): Unable to start service Intent { act=com.android.email.ACCOUNT_INTENT } U=0: not found
11-01 02:46:35.605: E/ActivityThread(701): Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d59c68 that was originally bound here
11-01 02:46:35.605: E/ActivityThread(701): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d59c68 that was originally bound here
11-01 02:46:35.605: E/ActivityThread(701): at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
11-01 02:46:35.605: E/ActivityThread(701): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
11-01 02:46:35.605: E/ActivityThread(701): at android.app.ContextImpl.bindService(ContextImpl.java:1418)
11-01 02:46:35.605: E/ActivityThread(701): at android.app.ContextImpl.bindService(ContextImpl.java:1407)
11-01 02:46:35.605: E/ActivityThread(701): at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
11-01 02:46:35.605: E/ActivityThread(701): at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157)
11-01 02:46:35.605: E/ActivityThread(701): at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145)
11-01 02:46:35.605: E/ActivityThread(701): at com.android.emailcommon.service.AccountServiceProxy.getDeviceId(AccountServiceProxy.java:116)
11-01 02:46:35.605: E/ActivityThread(701): at com.android.exchange.ExchangeService.getDeviceId(ExchangeService.java:1249)
11-01 02:46:35.605: E/ActivityThread(701): at com.android.exchange.ExchangeService$7.run(ExchangeService.java:1856)
11-01 02:46:35.605: E/ActivityThread(701): at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:551)
11-01 02:46:35.605: E/ActivityThread(701): at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:549)
11-01 02:46:35.605: E/ActivityThread(701): at android.os.AsyncTask$2.call(AsyncTask.java:287)
11-01 02:46:35.605: E/ActivityThread(701): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
11-01 02:46:35.605: E/ActivityThread(701): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
11-01 02:46:35.605: E/ActivityThread(701): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
11-01 02:46:35.605: E/ActivityThread(701): at java.lang.Thread.run(Thread.java:856)
11-01 02:46:35.740: E/StrictMode(701): null
11-01 02:46:35.740: E/StrictMode(701): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d59c68 that was originally bound here
11-01 02:46:35.740: E/StrictMode(701): at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
11-01 02:46:35.740: E/StrictMode(701): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
11-01 02:46:35.740: E/StrictMode(701): at android.app.ContextImpl.bindService(ContextImpl.java:1418)
11-01 02:46:35.740: E/StrictMode(701): at android.app.ContextImpl.bindService(ContextImpl.java:1407)
11-01 02:46:35.740: E/StrictMode(701): at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
11-01 02:46:35.740: E/StrictMode(701): at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157)
11-01 02:46:35.740: E/StrictMode(701): at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145)
11-01 02:46:35.740: E/StrictMode(701): at com.android.emailcommon.service.AccountServiceProxy.getDeviceId(AccountServiceProxy.java:116)
11-01 02:46:35.740: E/StrictMode(701): at com.android.exchange.ExchangeService.getDeviceId(ExchangeService.java:1249)
11-01 02:46:35.740: E/StrictMode(701): at com.android.exchange.ExchangeService$7.run(ExchangeService.java:1856)
11-01 02:46:35.740: E/StrictMode(701): at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:551)
11-01 02:46:35.740: E/StrictMode(701): at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:549)
11-01 02:46:35.740: E/StrictMode(701): at android.os.AsyncTask$2.call(AsyncTask.java:287)
11-01 02:46:35.740: E/StrictMode(701): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
11-01 02:46:35.740: E/StrictMode(701): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
11-01 02:46:35.740: E/StrictMode(701): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
11-01 02:46:35.740: E/StrictMode(701): at java.lang.Thread.run(Thread.java:856)
11-01 02:46:35.760: W/ActivityManager(308): Unbind failed: could not find connection for android.os.BinderProxy@410ee000
11-01 02:46:35.830: E/ActivityThread(701): Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d59728 that was originally bound here
11-01 02:46:35.830: E/ActivityThread(701): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d59728 that was originally bound here
11-01 02:46:35.830: E/ActivityThread(701): at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
11-01 02:46:35.830: E/ActivityThread(701): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
11-01 02:46:35.830: E/ActivityThread(701): at android.app.ContextImpl.bindService(ContextImpl.java:1418)
11-01 02:46:35.830: E/ActivityThread(701): at android.app.ContextImpl.bindService(ContextImpl.java:1407)
11-01 02:46:35.830: E/ActivityThread(701): at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
11-01 02:46:35.830: E/ActivityThread(701): at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157)
11-01 02:46:35.830: E/ActivityThread(701): at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145)
11-01 02:46:35.830: E/ActivityThread(701): at com.android.emailcommon.service.ServiceProxy.test(ServiceProxy.java:191)
11-01 02:46:35.830: E/ActivityThread(701): at com.android.exchange.ExchangeService$7.run(ExchangeService.java:1850)
11-01 02:46:35.830: E/ActivityThread(701): at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:551)
11-01 02:46:35.830: E/ActivityThread(701): at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:549)
11-01 02:46:35.830: E/ActivityThread(701): at android.os.AsyncTask$2.call(AsyncTask.java:287)
11-01 02:46:35.830: E/ActivityThread(701): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
11-01 02:46:35.830: E/ActivityThread(701): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
11-01 02:46:35.830: E/ActivityThread(701): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
11-01 02:46:35.830: E/ActivityThread(701): at java.lang.Thread.run(Thread.java:856)
11-01 02:46:35.890: E/StrictMode(701): null
11-01 02:46:35.890: E/StrictMode(701): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d59728 that was originally bound here
11-01 02:46:35.890: E/StrictMode(701): at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
11-01 02:46:35.890: E/StrictMode(701): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
11-01 02:46:35.890: E/StrictMode(701): at android.app.ContextImpl.bindService(ContextImpl.java:1418)
11-01 02:46:35.890: E/StrictMode(701): at android.app.ContextImpl.bindService(ContextImpl.java:1407)
11-01 02:46:35.890: E/StrictMode(701): at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
11-01 02:46:35.890: E/StrictMode(701): at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157)
11-01 02:46:35.890: E/StrictMode(701): at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145)
11-01 02:46:35.890: E/StrictMode(701): at com.android.emailcommon.service.ServiceProxy.test(ServiceProxy.java:191)
11-01 02:46:35.890: E/StrictMode(701): at com.android.exchange.ExchangeService$7.run(ExchangeService.java:1850)
11-01 02:46:35.890: E/StrictMode(701): at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:551)
11-01 02:46:35.890: E/StrictMode(701): at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:549)
11-01 02:46:35.890: E/StrictMode(701): at android.os.AsyncTask$2.call(AsyncTask.java:287)
11-01 02:46:35.890: E/StrictMode(701): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
11-01 02:46:35.890: E/StrictMode(701): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
11-01 02:46:35.890: E/StrictMode(701): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
11-01 02:46:35.890: E/StrictMode(701): at java.lang.Thread.run(Thread.java:856)
11-01 02:46:35.890: W/ActivityManager(308): Unbind failed: could not find connection for android.os.BinderProxy@411537c0
11-01 02:46:35.970: D/dalvikvm(701): GC_CONCURRENT freed 455K, 19% free 2479K/3056K, paused 80ms+14ms, total 335ms
11-01 02:46:57.460: D/dalvikvm(308): GC_CONCURRENT freed 783K, 34% free 6705K/10140K, paused 10ms+28ms, total 253ms