No, There wasn't any problem. I was calling the super class function
in else case. I had updated wrong adapter in the list view :(

On Aug 5, 9:30 am, Vance Turnewitsch <betweenthehi...@gmail.com>
wrote:
> I think there is a problem with your getView method. If the
> convertView is not null type.equalsIgnorCase(...)==true, then your
> view is not updated at all: getView returns the view that was passed
> in.
>
> On Aug 5, 1:53 am, Manish Garg <mannishga...@gmail.com> wrote:
>
> > Hi All,
>
> > I am using following adapter class when I am calling
> > notifyDataInvalidate and then notifyDataSetChanged, it is not updating
> > listview.
>
> > strangely I have two instance of this adapter, in one of them list is
> > getting updated.
>
> > public class CalendarEventAdapter  extends SimpleAdapter {
> >         List<HashMap<String, String>> mDataList;
> >         int mResource;
> >         Context mCtx;
>
> >         @SuppressWarnings("unchecked")
> >         public CalendarEventAdapter(Context context,
> >                         List<? extends Map<String, ?>> data, int resource,
> >                         String[] from, int[] to) {
> >                 super(context, data, resource, from, to);
> >                 mDataList = (List<HashMap<String, String>>) data;
> >                 mResource = resource;
> >                 mCtx = context;
> >         }
>
> >         @Override
> >         public int getCount() {
> >                 return super.getCount();
> >         }
>
> >         @Override
> >         public void notifyDataSetChanged() {
> >                 // TODO Auto-generated method stub
> >                 super.notifyDataSetChanged();
> >         }
>
> >         @Override
> >         public View getView(int position, View convertView, ViewGroup 
> > parent)
> > {
> >                 if (convertView == null) {
> >                         convertView = View.inflate(mCtx, mResource, null);
> >                 }
>
> >                 if (type.equalsIgnoreCase("Statement")) {
>
> >                         return convertView;
> >                 } else {
>
> >                         return super.getView(position, convertView, parent);
> >                 }
> >         }
>
> > }- Hide quoted text -
>
> > - Show quoted text -

-- 
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