How to add a search filter in RecyclerView to filter through parsed JSON data? edited

后端 未结 2 400
谎友^
谎友^ 2021-01-29 06:08

I am developing an android app which shows a list of countries affected by Coronavirus , the total number of confirmed cases and total Deaths. I am using a JSON API

相关标签:
2条回答
  • 2021-01-29 06:53

    The problem is with below initialization in the MainActivity.Oncreate method

    mCorona_Stats_Adapter = new Corona_Stats_Adapter(this,countries);
    

    Initialize the adapter in onPostExecute method with updated countries data.

    Hope this will help you.

    0 讨论(0)
  • 2021-01-29 07:03

    You have to set arraylist to update country data in adapter after getting data from the server.

    Public void setCoronaData (Arraylist coronaData) {
      countryList = coronaData;
      notifyDataSetChanged ();
    }
    
    0 讨论(0)
提交回复
热议问题