My intent was to use different view defined in xml when an item is
clicked.

I overwritten getView method in my child class of SimpleCursorAdapter:

        @Override
        public View getView(int position, View convertView, ViewGroup parent)
{

                if (position == mSelectedItemPos) {
                        Log.v(_TAG, "Highlight position " + position);
                        
setViewResource(R.layout.expense_his_list_row_hightlighted);
                } else {
                        Log.v(_TAG, "un-highlight position " + position);
                        setViewResource(R.layout.expense_his_list_row);
                }
                View newView = super.getView(position, convertView, parent);
                return newView;
       }

But it did not work as expected unless the activity is restarted.

Do not know why

and there's better choice to load different view for list item
dynamically?

thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to