Working with Fragments on Tablet Applications
You create a new activity for your table app, and now you have to add fragments to it. There’s no need to write new fragments to use with the tablet activity. However, you need to make some changes to your fragments to make sure they work properly in this new environment.
Communicating between fragments
If you try to add a task with your tablet application, it doesn’t show the edit fragment next to the list fragment as you expect, but instead opens a new activity to add a task.
The reason that your app opens the edit fragment in a new activity, rather than adjacent to the list fragment, is that it’s still doing exactly what it was told. It’s still executing the old phone behavior, which is to start ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access