O'Reilly logo

Android Application Development For Dummies, 2nd Edition by Donn Felker, Michael Burton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required