public class share {
public static void saveInfo(Context context,String username,String password)
{
SharedPreferences sp = context.getSharedPreferences("config", context.MODE_PRIVATE);
Editor editor = sp.edit();
editor.putString("username", username);
editor.putString("password", password);
editor.commit();
}
}
SharedPreferences sp = getSharedPreferences("config", MODE_PRIVATE);
String username = sp.getString("username", "");
String password = sp.getString("password", "");
usernameText.setText(username);
passwordText.setText(password);