Display of labels

android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Email Address" />

<EditText android:id="@+id/emailaddress" android:layout_width="fill_parent" android:layout_height="wrap_content" android:autoText="true" />

<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Server URL" />

<EditText android:id="@+id/serverurl" android:layout_width="fill_parent" android:layout_height="wrap_content" android:autoText="true" />

<Button android:id="@+id/settingssave" android:text="Save Settings" android:layout_height="wrap_content" android:layout_width="wrap_content" android:enabled="true" />

</LinearLayout>

The source code behind the settings screen is also very basic. Note the use of the Populate-Screen() method, which makes sure the EditView controls are populated with the current values stored in the SharedPreferences. Note also the use of the Prefs helper class to retrieve and save the values, as shown in listing 12.7

0 0

Post a comment