Question
Hello, I need help with this coding as I don't understand what to do. It is from Murach's Android programming 2nd edition. It is Chapter
Hello, I need help with this coding as I don't understand what to do. It is from Murach's Android programming 2nd edition. It is Chapter 8 exc 4. I am very confused as this was not actually discussed in the chapter so I am usure how to do it.
here are the instructions
In this exercise, youll modify the Tip Calculator app presented in this chapter so it uses an EditTextPreference element
1. Start Android Studio and open the project named ch08_ex4_TipCalculator.
2. Open the preferences.xml file in the xml directory. Add an EditTextPreference element for a setting named Name. This setting should allow the user to enter his or her full name. 3. Run the app and use the Settings activity to enter your name.
4. Open the layout of the activity. Modify the layout, so it includes a fifth row that can display a name. Open the class for the Tip Calculator activity. Modify this code so it gets the name from the preferences and displays that name in t
This is the current coding for preferences.xml
xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <CheckBoxPreference android:key="pref_remember_percent" android:title="@string/remember_percent_title" android:summary="@string/remember_percent_summary" android:defaultValue="true" /> <ListPreference android:key="pref_rounding" android:title="@string/rounding_title" android:summary="@string/rounding_summary" android:dialogTitle="@string/rounding_title" android:entries="@array/rounding_keys" android:entryValues="@array/rounding_values" android:defaultValue="@string/rounding_default" /> PreferenceScreen>
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started