2011-08-10 44 views
-1

我無法在我的Listview中單擊後創建一個intent。完成後,它給出了一個錯誤android listview intent

應用程序已意外停止,請重試

public void onItemClick(AdapterView<?> parent, View view, int position, long id) { 
    Intent IntentDiscution = new Intent(view.getContext(), lstchoi.class); 
    IntentDiscution.setClass(InterfaceAcceuil.this, lstchoi.class); 
    startActivityForResult(IntentDiscution, 0); 
} 
+1

你可以發佈logcat輸出嗎? – Pikaling

回答

1

確保您在聲明manifest.xml中lstchoi。假設這是一個活動,你會做這樣的事情:

<application android:icon="@drawable/icon" android:label="@string/app_name"> 

     <activity android:name=".lstchoi"/> 

您也可以刪除此行:

IntentDiscution.setClass(InterfaceAcceuil.this, lstchoi.class); 

,因爲你使用的構造函數來表示相同的信息是多餘的。