I have a various EditText
fields in my android app, what I want is on "Save" button click it should stored the entered value in sharedpreference and display it in a list view in another activity.
How would I do that?
I have a various EditText
fields in my android app, what I want is on "Save" button click it should stored the entered value in sharedpreference and display it in a list view in another activity.
How would I do that?
If you don't need the content of your editText after the application is closed, there is no need for SharedPreferences.just pass it using Intent like this.
EditText editText = findViewById(R.id.yourEditTextId);
Intent intent= new Intent();
intent.putExtra("key",editText.getText());
startActivity(intent);
In the other activity, you can get your editText value like this
String editTextValue=getIntent().getStringExtra("key");
If you have multiple EditText, you can use Room Database to store your Data which allows you to access it throughout the application.