android.R.layout.simple_list_item_checked not toggling in ListView

Posted by Mohit Deshpande on Stack Overflow See other posts from Stack Overflow or by Mohit Deshpande
Published on 2010-12-23T02:30:37Z Indexed on 2010/12/23 2:54 UTC
Read the original article Hit count: 250

Filed under:
|
|
|

Here is my custom adapter:

...
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
    LayoutInflater inflater = LayoutInflater.from(context);
    View v = inflater.inflate(android.R.layout.simple_list_item_checked, parent, false);
    return v;
}
...

Now this visually appears to be exactly what I needed. The problem is that I can't get toggle the checked state when I click on the listview item. Any solutions?

© Stack Overflow or respective owner

Related posts about java

Related posts about android