I implemented the android listview with the ListActivity. Here I have the problem that when i click on the list item no action is performed when the flash color is also not coming that is the orange color. So do you have any idea about this kindly answer to my question.
@Override
protected void onListItemClick(ListView l, View v, int position, long id)
{
super.onListItemClick(l, v, position, id);
Toast.makeText(getApplicationContext(), "msg msg", Toast.LENGTH_SHORT)
.show();
}
I put this code also into the Main ListActivity.
The first thing what you have to note here is, whenever there are Clickable elements like Buttons or
ImageButtonspresent in yourListViewelement, they take the control of click events. And so yourListViewwon’t get the chance to accept the click event.What you simply have to do is, set the
focusableattribute to false for theButtonorImageButtonyou have in your ListView. But still they will work without any problem and also your ListView’sonListItemClickwill also work.Try this,
Here I have added this
android:focusable="false"and it works fine. try it.