I call super.getView because I don't want to inflate the view and set
the value by myself. I want the parent class to do that for me but use
different view.

On 10月7日, 下午4时17分, Kumar Bibek <coomar....@gmail.com> wrote:
> View newView = super.getView(position, convertView, parent);
>
> Why are you calling the super.getView???
>
> http://android.amberfog.com/?p=296you 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 Bibekhttp://techdroid.kbeanie.comhttp://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

Reply via email to