1

I am a beginner in android

I have an Activity A (MainActivity) with two Fragments (F1,F2). Where the Fragment F1 having o RecyclerView(GridView) and Fragment F2 having RecyclerView(ListView).

To Feed data to these RecyclerView i am using Volley.

On starting application data loads in respective RecyclerView successfully BUT when I navigate to Activity A to B and return back to Activity A using back stack in Action bar data of RecyclerView gets parsed again through network so how to save the data of RecyclerView Once Created throughout the App life cycle to save Bandwidth consumption .

Is data is not properly geting Cache?

Is fragment Reload the view on Backstack?

  • When you press back fragment is recreated yes. You can use `SharedPreferences` to store data in activity A and avoid making network calls each time. You can access the `sharedpref` data from any activity. Here is an example https://stackoverflow.com/questions/23024831/android-shared-preferences-example – wick.ed Jun 26 '17 at 17:52

0 Answers0