Android Programming Tutorials

(Romina) #1
Menus and Messages

}

public void setName(String name) {
this.name=name;
}

public String getAddress() {
return(address);
}

public void setAddress(String address) {
this.address=address;
}

public String getType() {
return(type);
}

public void setType(String type) {
this.type=type;
}

public String getNotes() {
return(notes);
}

public void setNotes(String notes) {
this.notes=notes;
}

public String toString() {
return(getName());
}
}

Step #2: Add Notes to the Detail Form..............................................


Next, we need LunchList to make use of the notes. To do this, first add the


following TableRow above the Save button in our TableLayout in


LunchList/res/layout/main.xml:


<TableRow>
<TextView android:text="Notes:" />
<EditText android:id="@+id/notes"
android:singleLine="false"
android:gravity="top"
android:lines="2"
android:scrollHorizontally="false"
android:maxLines="2"
android:maxWidth="200sp"

58
Free download pdf