[android-beginners] Re: Removing ListItems

2009-08-16 Thread Mark Murphy
Matt wrote: > On 16 Aug., 03:07, Mark Murphy 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 >

[android-beginners] Re: Removing ListItems

2009-08-15 Thread Matt
On 16 Aug., 03:07, Mark Murphy 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

[android-beginners] Re: Removing ListItems

2009-08-15 Thread Mark Murphy
Matt wrote: > On 16 Aug., 01:23, Mark Murphy wrote: >> You don't remove it from the list. You remove it from the data source >> underlying the list. >> >> -- ArrayAdapter? Remove it straight from the adapter. >> >> -- CursorAdapter? Remove it from the database or content provider, then >> requery

[android-beginners] Re: Removing ListItems

2009-08-15 Thread Matt
On 16 Aug., 01:23, Mark Murphy wrote: > You don't remove it from the list. You remove it from the data source > underlying the list. > > -- ArrayAdapter? Remove it straight from the adapter. > > -- CursorAdapter? Remove it from the database or content provider, then > requery(). > > -- Other adap

[android-beginners] Re: Removing ListItems

2009-08-15 Thread Mark Murphy
Matt wrote: > I created a ListView from an array of strings. I also set an > OnItemLongClickListener. Inside that listener I actually want to > remove the list item that has been long-clicked on from the list, but > I don't know how. Is that even possible? You don't remove it from the list. You r