View newView = super.getView(position, convertView, parent); Why are you calling the super.getView???
http://android.amberfog.com/?p=296 you will find an example towards the end of this page. On Thu, Oct 7, 2010 at 1:36 PM, Xiongzh <zx.zhangxi...@gmail.com> wrote: > 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<android-developers%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- Kumar Bibek http://techdroid.kbeanie.com http://www.kbeanie.com -- 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