1.android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
解决方案:将getApplication改成xxxx.this
2.call you are unregister onbrocastRevicer?
解决方案:忘记注销广播
3.Installation error: INSTALL_FAILED_UPDATE_INCOMPATIBLE表示某个应用没有卸载完成
4.出现launch Activtiy not found ?因为这个Activity没有写main 和luncher参数
5.R.java was removed! Recreating R.java!
6.com.process.acore 表示的是这个应用程序有电话拨号进程
7.android.database.CursorIndexOutOfBoundsException解决方案:原因是应该先调用cursor.moveToFirst();。
数据库查询得到的cursor里面只有1个结果,你却查找第-1个,肯定不对
8.launcher.apk启动程序在启动动画页面卡住,原因是开机动画很暂用cpu,如果luancher里面的某部分代码阻塞了,或者某个自定义view中部分代码太占用CPU导致的。
9.java.lang.IllegalStateException: The specified child al
ready has a parent. You must call removeView() on the child's parent first,表示是缺少对象,
解决方法:查找对象是否还在,要么就是多次事例化了
10.java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ListView(2131230732, class android.widget.ListView) with Adapter(class com.cardroid.sdhc.medialist.SDMediaListAdapter)]
01-01 00:51:06.320: ERROR/AndroidRuntime(4035): at android.widget.ListView.layoutChildren(ListView.java:1492)
01-01 00:51:06.320: ERROR/AndroidRuntime(4035): at android.widget.AbsListView.onTouchEvent(AbsListView.java:2124)
01-01 00:51:06.320: ERROR/AndroidRuntime(4035): at android.widget.ListView.onTouchEvent(ListView.java:3315)
01-01 00:51:06.320: ERROR/AndroidRuntime(4035): at android.view.View.dispatchTouchEvent(View.java:3918)
01-01 00:51:06.320: ERROR/AndroidRuntime(4035): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:898)
01-01 00:51:06.320: ERROR/AndroidRuntime(4035): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:937)
01-01 00:51:06.320: ERROR/AndroidRuntime(4035): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:937)
解决方案:放入主线程中运行,因为此时这个LISTVIEW 加载ADAPTER是放入AsyTask里面运行的
11.Database( 2284): sqlite returned: error code = 14, msg = prepared
> statement aborts at 4: [DELETE FROM android_metadata]
> Database( 2284): DELETE failed setting locale
> Database( 2284): Failed to setLocale() when constructing, closing the
> database
> Database( 2284): android.database.sqlite.SQLiteException: unable to open
> database file
> Database( 2284): at
> android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
> Database( 2284): at
> android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1950)
> Database( 2284): at
> android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1818)
> Database( 2284): at
> android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:817)
> Database( 2284): at
> android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:851)
> Database( 2284): at
> android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:844)
> Database( 2284): at
> android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:542)
> Database( 2284): at
> android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:203)
> Database( 2284): at
> android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)
> Database( 2284): at
> android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:158)
> Database( 2284): at
> com.android.providers.media.MediaProvider.query(MediaProvider.java:1287)
> Database( 2284): at
> com.android.providers.media.MediaProvider.attachVolume(MediaProvider.java:3045)
> Database( 2284): at
> com.android.providers.media.MediaProvider.insertInternal(MediaProvider.java:1945)
> Database( 2284): at
> com.android.providers.media.MediaProvider.insert(MediaProvider.java:1665)
> Database( 2284): at android.content.ContentProvider
> $Transport.insert(ContentProvider.java:174)
> Database( 2284): at
> android.content.ContentResolver.insert(ContentResolver.java:587)
> Database( 2284): at
> com.android.providers.media.MediaScannerService.openDatabase(MediaScannerService.java:65)
> Database( 2284): at
> com.android.providers.media.MediaScannerService.scan(MediaScannerService.java:113)
> Database( 2284): at
> com.android.providers.media.MediaScannerService.access
> $400(MediaScannerService.java:53)
> Database( 2284): at com.android.providers.media.MediaScannerService
> $ServiceHandler.handleMessage(MediaScannerService.java:283)
> Database( 2284): at
> android.os.Handler.dispatchMessage(Handler.java:99)
> Database( 2284): at android.os.Looper.loop(Looper.java:123)
> Database( 2284): at
> com.android.providers.media.MediaScannerService.run(MediaScannerService.java:197)
> Database( 2284): at java.lang.Thread.run(Thread.java:1096)
> SQLiteOpenHelper( 2284): Couldn't open external.db for writing (will try
> read-only):
> SQLiteOpenHelper( 2284): android.database.sqlite.SQLiteException: unable
> to open database file
> SQLiteOpenHelper( 2284): at
> android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
> SQLiteOpenHelper( 2284): at
> android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1950)
> SQLiteOpenHelper( 2284): at
> android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1818)
> SQLiteOpenHelper( 2284): at
> android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:817)
> SQLiteOpenHelper( 2284): at
> android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:851)
> SQLiteOpenHelper( 2284): at
> android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:844)
> SQLiteOpenHelper( 2284): at
> android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:542)
> SQLiteOpenHelper( 2284): at
> android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:203)
> SQLiteOpenHelper( 2284): at
> android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)
> SQLiteOpenHelper( 2284): at
> android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:158)
> SQLiteOpenHelper( 2284): at
> com.android.providers.media.MediaProvider.query(MediaProvider.java:1287)
> SQLiteOpenHelper( 2284): at
> com.android.providers.media.MediaProvider.attachVolume(MediaProvider.java:3045)
> SQLiteOpenHelper( 2284): at
> com.android.providers.media.MediaProvider.insertInternal(MediaProvider.java:1945)
> SQLiteOpenHelper( 2284): at
> com.android.providers.media.MediaProvider.insert(MediaProvider.java:1665)
> SQLiteOpenHelper( 2284): at android.content.ContentProvider
> $Transport.insert(ContentProvider.java:174)
> SQLiteOpenHelper( 2284): at
> android.content.ContentResolver.insert(ContentResolver.java:587)
> SQLiteOpenHelper( 2284): at
> com.android.providers.media.MediaScannerService.openDatabase(MediaScannerService.java:65)
> SQLiteOpenHelper( 2284): at
> com.android.providers.media.MediaScannerService.scan(MediaScannerService.java:113)
> SQLiteOpenHelper( 2284): at
> com.android.providers.media.MediaScannerService.access
> $400(MediaScannerService.java:53)
> SQLiteOpenHelper( 2284): at
> com.android.providers.media.MediaScannerService
> $ServiceHandler.handleMessage(MediaScannerService.java:283)
> SQLiteOpenHelper( 2284): at
> android.os.Handler.dispatchMessage(Handler.java:99)
> SQLiteOpenHelper( 2284): at android.os.Looper.loop(Looper.java:123)
> SQLiteOpenHelper( 2284): at
> com.android.providers.media.MediaScannerService.run(MediaScannerService.java:197)
> SQLiteOpenHelper( 2284): at java.lang.Thread.run(Thread.java:1096)
解决方案:DBHELPER打开数据库的链接后,没有关闭,导致下次进入有问题,同时有的把数据库放入SDCARD,要加SDCARD的权限。
12.在LINUX下面出现R。JAVA文件不生成的时候,是因为SDK下面的platforms/android-8/tools要加权限,为了方便常用
platforms/android-8/tools$ chmod a+x *
13: 问题描述:E/WindowManager( 5523): android.view.WindowLeaked: Activity com.cardroid.sdhc.medialist.SDMediaListActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@30c45e38 that was originally added here
解决方案:即未能及时销毁某个PhoneWindow。当前Activity被关闭。而在关闭的同时,却没能及时的调用dismiss来解除对ProgressDialog等的引用,从而系统抛出了标题中的错误,而掩盖了真正导致这个错误的异常信息。需要在ONDESTORY方法时候关闭一些DIALOG。