DetailsFragment Instance Variables
Figure 8.43 shows the class’s instance variables. Line 34 declares variable listener
which will refer to the object (MainActivity
) that implements the DetailsFragmentListener
interface. Variable rowID
represents the current contact’s unique row ID in the database. The TextView
instance variables (lines 37–43) are used to display the contact’s data on the screen.
34 private DetailsFragmentListener listener;35 36 private long rowID = -1; // selected contact's rowID37 private TextView nameTextView; // displays contact's name38 private TextView phoneTextView; // displays contact's phone39 private TextView emailTextView; // displays contact's email40 private TextView streetTextView; ...
Get Android™ How to Program, Second 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.