android - notifydatasetchange() not working in post method of asynch task -


i have custom listview , data getting change frequently.so updating listview have registered broad cast receiver in activity , initialising list again , calling notifydataset change in post method.but list data not getting change.for temparary solution have intialised adapter object againg , setting againg.but feel not option.can 1 tell me how task.her code of broadcast receiver.

  private  class listenchange extends broadcastreceiver {          @override         public void onreceive(final context context, intent intent) {              if(intent.getaction().equals(conversationlistactivitynew.action_change))             {                 if(is_activity_visible) {                     if (uri != null&&adapter!=null) { //                          adapter =null; //                          adapter = new messageadapternew(messagelistactivitynew.this, uri, searched_text); //                          setlistadapter(adapter);                              new asynctask<void,void,void>()                              {                                   @override                                  protected void doinbackground(void... voids) {                                      adapter.getdata(messagelistactivitynew.this,uri);                                      return null;                                  }                                   @override                                  protected void onpostexecute(void avoid) {                                      log.e("notifying row","notifying row");                                      messagelistactivitynew.this.adapter.notifydatasetchanged();                                      super.onpostexecute(avoid);                                  }                              }.execute();                      }                 }              }          }     } 


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -