CopyPastor

Detecting plagiarism made easy.

Score: 1.9743309357539327; Reported for: String similarity, Exact paragraph match Open both answers

Possible Plagiarism

Plagiarized on 2019-03-17
by Murat Durmaz

Original Post

Original - Posted on 2012-06-12
by Anshul Agarwal



            
Present in both answers; Present only in the new answer; Present only in the old answer;

In Activity1 while saving preferences use:
SharedPreferences mPrefs = getSharedPreferences("IDvalue", 0); //Give any name for //preference as I have given "IDvalue" and value 0. SharedPreferences.Editor editor = mPrefs.edit(); editor.putString(key, value); // give key value as "sound" you mentioned and value what you // to want give as "1" in you mentioned editor.commit();
In Activity2 while retrieving shared values use :
SharedPreferences mPrefs = getSharedPreferences("IDvalue",0); String str = mPrefs.getString("sound", ""); if (str.equals("1")) { // Do what you want } else { // Do what you want }



In Activity1 while saving preferences use:
SharedPreferences mPrefs = getSharedPreferences("IDvalue", 0); //Give any name for //preference as I have given "IDvalue" and value 0. SharedPreferences.Editor editor = mPrefs.edit(); editor.putString(key, value); // give key value as "sound" you mentioned and value what you // to want give as "1" in you mentioned editor.commit(); In Activity2 while retrieving shared values use : SharedPreferences mPrefs = getSharedPreferences("IDvalue",0); String str = mPrefs.getString("sound", ""); if (str.equals("1")) { // Do what you want } else { // Do what you want }

        
Present in both answers; Present only in the new answer; Present only in the old answer;