ListView with CursorAdapter is not refreshing even if I use swapCursor or changeCursor methods in Android -


i have 2 activities initial listview , fab , second 1 edittext, save , clear buttons.

i call second 1 activity result enter values , click save button. list not refreshed its displaying first element , did following

in first activity

@override protected void onactivityresult(int requestcode, int resultcode, intent data) {     super.onactivityresult(requestcode, resultcode, data);     // check if request code same passed  here 2     if(requestcode==3)     {          player = mhelper.getplayersbyteam(new_id);          if(player!=null && player.getcount()>0)         {             playerdataadapter = new playeradapter(this, player);             // assign adapter listview             listplayers.setadapter(playerdataadapter);             playerdataadapter.notifydatasetchanged();             playerdataadapter.swapcursor(mhelper.getplayersbyteam(new_id));         }      } 

what doing wrong here? why listview not displaying refreshed data

check database if retrieve proper records


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -