So instead of creating a database, I\'m storing the data using SharedPreference.
SharedPreference
My code is below:
SharedPreferences.Editor editor =
See docs about getPrefernces method:
getPrefernces
Retrieve a SharedPreferences object for accessing preferences that are private to this activity.
So, if you want to share preferences between activities you should use getSharedPreferences with specified name.