0

In my application, I created android:process:xxx. I am trying to put a String value in preference from the process xxx components with the key of "name". After this i am trying to get the value with same key from Activity. Activity is not belongs to process xxx.

I created my shared preference like below.

mPref = getSharedPreferences(PREF_FILE_NAME, MODE_MULTI_PROCESS);
mEditor = mPref.edit();
Manikanta Ottiprolu
  • 751
  • 1
  • 7
  • 23

2 Answers2

1

If you have two or more processes on your app, instead of shared preferences, create one table in your database. Save the values in that table.

0
public SessionManager(Context context){
    this._context = context;
    //make mode as private
    pref = _context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
    editor = pref.edit();
}
impathuri
  • 574
  • 6
  • 21