Matt wrote:
> On 16 Aug., 03:07, Mark Murphy <mmur...@commonsware.com> wrote:
>> You gave it an array. To be able to modify it at runtime, you need to
>> give it an ArrayList.
> 
> Alright, that did work. But why? Why is there an ArrayAdapter with a
> method called "remove" that you cannot use to remove an item from an
> array? The solution with that ArrayList seems to be not very obvious,
> if I may say so.

ArrayAdapter does not convert the array you hand it into an ArrayList.
Since you cannot remove from a Java array, ArrayAdapter cannot remove
it, either.

My guess is that the array-versus-ArrayList thing is an optimization for
short static lists, as arrays should take less memory and are probably
faster.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Looking for Android opportunities? http://wiki.andmob.org/hado

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

Reply via email to