CopyPastor

Detecting plagiarism made easy.

Score: 0.8448721579224657; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2015-08-28
by Lal

Original Post

Original - Posted on 2014-05-13
by Lal



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

You can use **SharedPreferences** for that..
SharedPreferences wmbPreference1,wmbPreference2; SharedPreferences.Editor editor; //wmbPreference1 for Shared Prefs that lasts forever wmbPreference1 = PreferenceManager.getDefaultSharedPreferences(this); //wmbPreference2 for Shared Prefs that lasts only just once each time program is running wmbPreference2 =getApplicationContext().getSharedPreferences("MYKEY",Activity.MODE_PRIVATE);
**To save values**
SharedPreferences.Editor editor = wmbPreference1.edit(); editor.putString("MYKEY", "12345"); editor.commit();
You can **retrieve the values** like
String Phonenumber = wmbPreference1.getString("MYKEY", "");
where **MYKEY** is the **keyname** by which you can identify the value..
You can use `SharedPreferences ` for that..
SharedPreferences wmbPreference1,wmbPreference2; SharedPreferences.Editor editor;
//wmbPreference for Shared Prefs that lasts forever wmbPreference1 = PreferenceManager.getDefaultSharedPreferences(this); //installsp for Shared Prefs that lasts only just once each time program is running wmbPreference2 =getApplicationContext().getSharedPreferences("install_code_prefs",Activity.MODE_PRIVATE);
To save values
SharedPreferences.Editor editor = wmbPreference1.edit(); editor.putString("MYKEY", "12345"); editor.commit();
You can retrieve the values like
String Phonenumber = wmbPreference1.getString("MYKEY", ""); where **MYKEY** is the keyname by which you can identify the value..

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