[android-developers] problem display all data sharedpreference
I save data url,device name but when call getstring display only device name...this is my function....for one string work ok....
public void Save(View view) {
SharedPreferences preferences = getSharedPreferences("dataioweb.txt" , MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit(); // Put the values from the UI
EditText txtUrl = (EditText)findViewById(R.id.txtUrl);
String strUrl = txtUrl.getText().toString();
EditText txtDevName = (EditText)findViewById(R.id.txtDevName);
String strDevName = txtDevName.getText().toString();
//CheckBox chkTandC = (CheckBox)findViewById(R.id.chkTandC);
//boolean blnTandC = chkTandC.isChecked();
editor.putString("Url", strUrl); // value to store
editor.putString("DevName", strDevName); // value to store
//editor.putBoolean("TandC", blnTandC); // value to store
// Commit to storage
editor.commit();
String strValue = preferences.getString("Url","");
TextView text = (TextView) findViewById(R.id.text);
text.setText(strValue);
String strValue2 = preferences.getString("DevName","");
TextView text2 = (TextView) findViewById(R.id.textDevName);
text.setText(strValue2);
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home