android listview order changed when called notifyDataSetChanged -


all. when use notifydatasetchanged(), listview display order change .

like this

  • 3
  • 2
  • 1

    when current activy created. when change data.

  • 1
  • 2
  • 3

i don't want order changed , dont understand why happening.

this piece of code adapter class

    public static class itemadapter extends baseadapter {          private string[] mdata;         private layoutinflater minflater;  // called method  change data         public void setedittext(int position, final string item) {             mdata[position] = item;             notifydatasetchanged();         }    } 

i change data @ dialog this

       builder = new alertdialog.builder(ct);                             builder.settitle(r.string.pickstatus)                                     .setview(edbuffer)                                     .setpositivebutton(r.string.save, new dialoginterface.onclicklistener() {                                                 @override                                                 public void onclick(                                                         dialoginterface dialog, int id) {                                                     // todo auto-generated method stub                                                     canpop = true;                                                     final string tmp = edbuffer.gettext().tostring();                                                     kbonezlog.e(string.format( "set key %d", key));  //use mdata key set value setedittext(key, tmp); dialog.dismiss(); }}) 

it's hard tell what's going on without seeing full source code adapter, sounds issue in implementation of getview(). every time getview() invoked must rebind data.


Comments

Popular posts from this blog

c# - IMAP GMAIL getting folder list problem -

CUDA shared memory -