Question: IN ANDROID STUDIO Create an android MainActivity.xml that has the following components: EditText txtFname EditText txtLname EditText txtHeight EditText txtAge EditText txtWeight EditText txtEmail Button
IN ANDROID STUDIO Create an android MainActivity.xml that has the following components:
- EditText txtFname
- EditText txtLname
- EditText txtHeight
- EditText txtAge
- EditText txtWeight
- EditText txtEmail
- Button btnSave
- Button btnLoad
- Button btnDelete
You are requested to create three methods :
1- SavePreferences() that reads the values given by the user in the above text fields and saves them in a SharedPreferences object. This method should be called when the user clicks on btnSave.
2- LoadPreferences() that loads the saved preferences above and displays them in the edit texts. To note, that if no value is saved, each edit text should display then Please enter a value instead. This method should be called when the user clicks on btnLoad.
3- DeletePreferences() that will empty the content of the SahredPreferences object saved. This method should be called when the user clicks on btnDelete.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
