貼出代碼片段:
import android.app.Activity;
import android.app.Bundle;
import android.app.ListActvity;
import android.app.ListView;
import android.app.AbsListView;
import android.app.AdapterView;
....
public class MyDemo extends ListActivity {
@Override public void onCreate(Bundle icicle) {
ListView myLV = (ListView) findViewByID(R.id.ListView1);
myLV.setChoiceMode(SINGLE_CHOICE_MODE);
}
}
當我編輯時,javac報告錯誤:can't find symbol SINGLE_CHOICE_MODE. Any ideas
?
我沒有導入正確的文件嗎?
應該是這個 ListView.CHOICE_MODE_SINGLE