December 2015
Beginner
698 pages
15h 16m
English
We know that TitlesFragment needs a way to communicate with ViewFragment, but also TagsFragment needs a way of telling TitlesFragment which tag it would like to use for the criteria to search for database entries with the matching tag.
This same interface will handle all this work. MainActivity can then implement the interface and handle the inter-fragment communication.
Create a new class called ActivityComs and code it into our interface by editing it to exactly the code shown next:
public interface ActivityComs {
void onTitlesListItemSelected(int pos);
void onTagsListItemSelected(String tag);
} We now have two methods we can use for communicating between our Fragment classes and MainActivity. One (onTitlesListItemSelected ...
Read now
Unlock full access