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