@pawegio right, if you want to use same vol level what user set up, use preferences.
This is how to:
WRITE into preferences
SharedPreferences pref =
context.getSharedPreferences("MyAppPreferences", Context.MODE_PRIVATE);
/*
* Get the editor for this object. The editor interface abstracts the implementation of
* updating the SharedPreferences object.
*/
SharedPreferences.Editor editor = pref.edit();
/*
* Write the keys and values to the Editor
*/
editor.putInt("VolumLevel", 60);
/*
* Commit the changes. Return the result of the commit.
*/
e.commit();
READ from preferences
SharedPreferences pref = context.getSharedPreferences("MyAppPreferences", MODE_PRIVATE);
int volLevel = pref.getInt("VolumLevel", 50 /*Default if value wasn't setup yet*/);
return volLevel;