I have designed a custom listview. In that view i have one textview and two edittext fields. when i am clicking on the individual rows in listview that perform another activity(i.e another page will open). But i cannot perform onclick action on my listview.
나는 코드를 작성했지만 작동하지 않습니다. 나는 아래 코드를 보여 주었다.listview에서 onclick 액션을 수행하려면 어떻게해야합니까?
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.sharefolioedit);
getList();
lv.setAdapter(new EfficientAdapter(this));
lv = getListView();
lv.setClickable(true);
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parentView, View childView,
int position, long id) {
Intent intent = new Intent(CategoryList.this,AddSubCategoryList.class);
startActivity(intent);
}
}
당신이'}'을 누락? 나는 3 개의 오프닝 브래킷을보고 있지만 닫는 것은 2 개뿐입니다 ... – DrColossos
그래서 일부 logcat 출력이 있습니까? 일부 Log.d ("Debug", "..") 항목을 코드에 추가하여 실행되는 줄과 실행되지 않는 줄을 확인하십시오. 나는 listviews onclick 일반적으로 좋은 작품을 말할 수 있습니다. – mad