Just store the int value of the recycler view in shared preference. Finally in oncreate() retrieve that value and set it by calling scrollPosition(your_position). That's all.
Greate Vedio But, i have one Question Once i do Sharedpreferences in one Activity, i can't change key value from other activity? So any solution for that
No. you can change the value from anywhere but you should use the correct cotext mode. In order to allow your SharedPreference globally available instead of single activity read/write permission.
Superb video Subhojit. Totally practical with solid theory incorporated into it. Keep them comming! Great Work
Thank you 😊
very good video helped me and i learned how it works tnx alot
Wonderful explanation .... I hope to do many more advanced course explanations for shared preferences ....
Sure, I will. But you can also request your topic also.
First: Thank you very much for your kindness.
I need to know more about OnSharedPreferenceChangeListener
I have already created an example on that topic. So have you seen that? Would you like to see another example?
@@DailyCoding yes, I need examples of uses for shared preferences
SharedPreferencesBackupHelper;
SharedPreferencesCompat;
PreferenceFragment
Okay! You are actually looking for a Settings screen. Right!
Amazing...... Keep it up dude...!!!😊
Thank you.
#dailycoding
Great 👍
Thanks. Stay connected!
Nice video
Thanks
Ohhh.. cool stufff.... 💯💯💯
I want to save and retrieve my Scrollview scroll position where user exit the app. How should I do that?
Just store the int value of the recycler view in shared preference. Finally in oncreate() retrieve that value and set it by calling scrollPosition(your_position). That's all.
Hi sir. When I close the application in background, the saved data (in my case boolean) is lost when i reopen it. Any solution?
Thanks
Watch this video carefully. Hope it will help.
I want to save coundown timer to shared preferences and coundown does not reset even on backpress or close app until onfinish
Override onBackPressed method and stop your timer there. That's it.
@@DailyCoding i found another working method in the mean time, thanks for your reply.
Using shared preferences
@@khalidmahmood418 yes, you can save timer value in that method
Greate Vedio
But, i have one Question
Once i do Sharedpreferences in one Activity, i can't change key value from other activity? So any solution for that
No. you can change the value from anywhere but you should use the correct cotext mode. In order to allow your SharedPreference globally available instead of single activity read/write permission.
So, any vedio about how to change from other activity??
I use SQLite instead
@@drtamer545 you should create a Sharedpreference instance on another activity and use the same key as you used earlier.
@@drtamer545 You can also use SQLite or Room if you have a complex data set.
I tried the Same key from other activity, but can't change data inside the Sharedpreference Key
thanks for the video
but i have a problem when i call load method in other Activity App crash
Please drop the error code
Peace
thanks very much ,,
Welcome.