Listing 912 reslayoutdiaryxml

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

android:orientation="vertical"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Diary Title"

<EditText android:id="@+id/diarydescriptionText"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

<TextView android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="Content"

<EditText android:id="@+id/diarycontentText" android:layout_width="fill_parent" android:layout_height="200dp"

<Button android:id="@+id/submitButton"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="submit"

android:textSize="20dp"

</LinearLayout>

Figure 9.3 The diary entry creation screen.

The main activity is Diary.java, shown in Listing 9.13.The com.cookbook.data package needs to be imported, and the MyDB object is declared, initialized, and opened for use. It also displays the diary.xml layout and handles the submit button press to save data to the database.

Character Building Thought Power

Character Building Thought Power

Character-Building Thought Power by Ralph Waldo Trine. Ralph draws a distinct line between bad and good habits. In this book, every effort is made by the writer to explain what comprises good habits and why every one needs it early in life. It draws the conclusion that habits nurtured in early life concretize into impulses in future for the good or bad of the subject.

Get My Free Ebook


Post a comment