by "overriding the default ArrayAdapter" I mean overriding the getView(), getViewTypeCount() and getItemViewType() methods. This is the recommended way of changing the ways the items are displayed according to the javadoc, so I guess it should not cause problem :
"To use something other than TextViews for the array display, for instance, ImageViews, or to have some of data besides toString() results fill the views, override getView(int, View, ViewGroup) to return the type of view you want." Anyways, I have tried to remove all my overrided methods and the problem is still there ... On Jun 17, 10:42 am, Kumar Bibek <[email protected]> wrote: > > > > I have a strange problem with one of my ListActivity. I have overrided > > > > the default ArrayAdapter in order to customize my list. I have then > > > > filled the adapter with an ArrayList. > > This is a custom array adapter. > > Thanks and Regards, > Kumar Bibekhttp://tech-droid.blogspot.com > > On Jun 17, 1:27 pm, Christophe <[email protected]> > wrote: > > > the only example I have found for ArrayAdapter in the API example > > doesn't show how to add element in the array : > > >http://developer.android.com/resources/samples/ApiDemos/src/com/examp... > > > and getCount() is not overrided in this example ... > > > On Jun 16, 9:39 pm, Kumar Bibek <[email protected]> wrote: > > > > You have to override the getCount method. Please go through the > > > examples to check how the Adapters work. > > > > Thanks and Regards, > > > Kumar Bibekhttp://tech-droid.blogspot.com > > > > On Jun 16, 6:07 pm, Christophe <[email protected]> > > > wrote: > > > > > hello everyone, > > > > > I have a strange problem with one of my ListActivity. I have overrided > > > > the default ArrayAdapter in order to customize my list. I have then > > > > filled the adapter with an ArrayList. > > > > > If I insert an element on the list and then call > > > > notifyDataSetChanged() on the adapter everything works fine. > > > > > But if I insert an element at the END of the list and then call > > > > notifyDataSetChanged(), the new element doesn't appear ... > > > > > And finally if I override getCount() on my adapter like this : > > > > > @Override > > > > public int getCount() { > > > > return myArrayList.size(); > > > > > } > > > > > then everything works fine. > > > > Is this a bug or am I doing something wrong ? > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

