[android-developers] Re: Remove a row in a Listview

2010-07-09 Thread karteek
use the methode remove with position of the row
mAdapter.remove(2);

On Jul 9, 2:32 am, Albert albert8...@googlemail.com wrote:
 Hi all,

 Does someone know how to remove a row from a Listview?

 I have an Adapter that takes care of the List and when I try
 mAdapter.remove(Object) it does not remove the Object I passed but
 instead the last row on the list. I have tried different ways and it
 always ends up deleting the last row.

 Thanks in advance,
 Alberto

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


[android-developers] Re: Remove a row in a Listview

2010-07-09 Thread Albert
Thanks karteek for your answer but it does not work as my adapter
takes a list of Strings.

mAdapter.remove(String) should actually work, I have override
getCount() as well but still no luck...

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


[android-developers] Re: Remove a row in a Listview

2010-07-09 Thread JoksanCPEN
have you tried to delete the element from the array instead of
deleting it from the listview?

On Jul 9, 2:12 am, karteek kartee...@gmail.com wrote:
 use the methode remove with position of the row
 mAdapter.remove(2);

 On Jul 9, 2:32 am, Albert albert8...@googlemail.com wrote: Hi all,

  Does someone know how to remove a row from a Listview?

  I have an Adapter that takes care of the List and when I try
  mAdapter.remove(Object) it does not remove the Object I passed but
  instead the last row on the list. I have tried different ways and it
  always ends up deleting the last row.

  Thanks in advance,
  Alberto



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


[android-developers] Re: Remove a row in a Listview

2010-07-09 Thread Albert


On Jul 9, 2:23 pm, JoksanCPEN joksan...@gmail.com wrote:
 have you tried to delete the element from the array instead of
 deleting it from the listview?


Yes and then I call notifyDataSetChanged() and it only deletes the
last one.

A temporary solution I'm using is when a row is deleted, the item gets
deleted from the database and then I just initialise everything again
and get all the info from the DB.

It would obviously nice not to have to do that...

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