Adding a Suspect to the Model Layer
Next, open Crime.java and add a new member variable to give Crime a field that will hold the name of a suspect.
Listing 15.2 Adding suspect field (Crime.java
)
public class Crime { ... private boolean mSolved; private String mSuspect; public Crime() { this(UUID.randomUUID()); } ... public void setSolved(boolean solved) { mSolved = solved; } public String getSuspect() { return mSuspect; ...
Get Android Programming: The Big Nerd Ranch Guide, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.