Попробуйте это:
Используя SharedPreferences, отредактируйте данные следующим образом:
SharedPreferences pref = getApplicationContext().getSharedPreferences("MyPrefsSkip", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = pref.edit();
editor.putString("username",username); // Storing string
editor.putString("phone",phone);
editor.putString("image",image);// Storing string
editor.apply();
получите данные в следующем действии, как это
/* using sharedpref to get data*/
private void getSharedprefData() {
SharedPreferences prefs = getSharedPreferences("MyPrefsSkip", Context.MODE_PRIVATE);
username= prefs.getString("username", null);
phone= prefs.getString("phone", null);
image= prefs.getString("image", null);
}
, используя SharedPreferences, установите данные в текстеВот как это выглядит:
userName.setText(username);
phone.setText(phone);
set Image Используя Glide, вот так:
RequestOptions options = new RequestOptions()
.centerCrop()
.placeholder(R.drawable.no_preview)
.error(R.drawable.no_preview)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.priority(Priority.HIGH)
.dontAnimate()
.dontTransform();
Glide.with(context)
.load(image)
.apply(options)
.into(uploadiImage);
Я надеюсь, что это поможет вам.