Coding TagsFragment
All the TagsFragment
class needs to do is display a list of tags from the appropriate table and when the user clicks one, let MainActivity
know via the ActivityComs
interface.
Add the ActivityComs
interface as a new member variable as highlighted in the following code:
public class TagsFragment extends ListFragment {
private ActivityComs mActivityComs;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
private ActivityComs mActivityComs;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
}
As we have seen upon just coding TitlesFragment
, the next code allows us to:
- Get access to the database
- Get the list of tags from
wis_table_tags
- Set up ...
Get Android Programming for Beginners 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.