Android開發中遇到的exception

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lam.fundamental/com.lam.datasave.dairy.DairyActivity}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'java


環境:在啓動ListActivity的時候拋出android

緣由:android:id="@+id/android:xxxList"web

解決:把上面的改爲:android:id="@+id/android:list"
數據庫


android.content.ActivityNotFoundException: Unable to find explicit activity class {***************.DiaryEditActivity}; have you declared this activity in your AndroidManifest.xml?
this

環境:啓動activity的時候拋出spa

緣由:AndroidManifest.xml文件中未聲明activityrest

解決:在AndroidManifest.xml中聲明相應得activity.orm


java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lam.fundamental/com.lam.datasave.dairy.DairyActivity}: java.lang.IllegalArgumentException: column '_id' does not exist
xml

環境:使用cursor的時候拋出進程

緣由:cursor強制要求以"_id"爲主鍵,數據庫的表中沒有以"_id"或者"id"命名的字段

解決:在數據庫相應的表中加上該字段



The connection to adb is down, and a severe error has occured.

[2015-07-07 17:13:33 - Test] You must restart adb and Eclipse.

[2015-07-07 17:13:33 - Test] Please ensure that adb is correctly located at 'D:\DEV\tools\Android_SDK\sdk\platform-tools\adb.exe' and can be executed.


環境:運行項目的時候

緣由:端口占用;

解決:關閉相應進程。不少軟件帶有手機助手功能,好比qq,豌豆莢,360等,在作開發的時候最好把相應功能給關閉。


FATAL EXCEPTION: main

android.view.InflateException: Binary XML file line #2: Error inflating class com.lam.myview.ToDoList

at android.view.LayoutInflater.createView(LayoutInflater.java:596)


環境:使用自定義組件的時候拋出;

緣由:缺乏構造器,使用資源文件構造自定義控件時,必須有包含context 和 attributeset 這兩個參數的構造器

解決:在自定義的控件中添加構造器。



activity.SoftwareManagerActivity has leaked window android.widget.LinearLayout{ff5f484 V.E..... ........ 0,0-264,87} that was originally added here

            at android.view.ViewRootImpl.<init>(ViewRootImpl.java:363)

            at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:261)

            at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)

環境:在顯示popupwindow的狀況下,連續點擊回退鍵時拋出。

緣由:有些控件須要依賴別的控件而存在,正如此處的popupwindow,因此,當連續點擊back鍵時,popupwindow依賴的activity被銷燬了,致使異常拋出。

解決:在activity銷燬前,將popupwindow給dismiss掉。

相關文章
相關標籤/搜索