开发者

I am not able to select a particular row in listview

Hello all I created a custom listview through my custom adapter..

    CustomAdapter adapter  = new CustomAdapter(MainPage.this, dbHelper, imgId, title);
                    adapter.setList(list1);
                    list1.setAdapter(adapter);


                    list1.setOnItemClickListener(new OnItemClickListener() {

                        @Override
                        public void onItemClick(AdapterView<?> arg0, View arg1,
                                int arg2, long arg3) {
                            // TODO Auto-generated method stub
                            Log.i("hello",arg2+"item clicked ....");
                            Toast.makeText(MainPage.this, "Kindly enter search parameter!!", Toast.LENGTH_SHORT).show();
                        }
                    });
-- 

Now i am not able to select any item. I dont know开发者_开发百科 why.....


try setting the inflated view "Clickable" and "able to listen to click events" in your adapter class getView() method.

convertView = mInflater.inflate(R.layout.your_layout, null);
convertView.setClickable(true); 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜