String username = etName.getText().toString();
String age = etAge.getText().toString();
SharedPreferences sharedPreferences = MainActivity.this
.getSharedPreferences("person", Context.MODE_PRIVATE);
Editor editor = sharedPreferences.edit();
editor.putString("name", username);
editor.putString("age", age);
String age = etAge.getText().toString();
SharedPreferences sharedPreferences = MainActivity.this
.getSharedPreferences("person", Context.MODE_PRIVATE);
Editor editor = sharedPreferences.edit();
editor.putString("name", username);
editor.putString("age", age);
editor.commit();
Map<String, String> map = new HashMap<String, String>();
SharedPreferences sharedPreferences = MainActivity.this
.getSharedPreferences("person", Context.MODE_PRIVATE);
map.put("name", sharedPreferences.getString("name", ""));
map.put("age", sharedPreferences.getString("age", "0"));