how to refresh custom listview using baseadapter in android

后端 未结 5 764
无人及你
无人及你 2020-12-08 23:37

sir, how can i refresh my custom listview using baseadapter. i don\'t know what to place, or where to place it in my code. please help me. thanks in advance



        
5条回答
  •  萌比男神i
    2020-12-09 00:05

    I solved this issue adding this function to my custom adapter

    public void newCursor(Cursor cursor)
     {
      this.cursor=cursor;
      this.notifyDataSetChanged();
     }
    

    From my main class I create a new cursor doing a re-query to database and then send to my custom adapter via this function.

    good luck

提交回复
热议问题