Sie sind auf Seite 1von 3

Developers

Training

API Guides

Design

Reference

Getting Started
Building Your First App
Supporting Different Devices
Managing the Activity Lifecycle
Building a Dynamic UI with Fragments
Creating a Fragment
Building a Flexible UI

Develop

Tools

Console

Distribute

Google Services

Samples

Preview

Building a Dynamic UI with


Fragments
To create a dynamic and multi-pane user interface on
Android, you need to encapsulate UI components and
activity behaviors into modules that you can swap into
and out of your activities. You can create these modules
with the Fragment class, which behaves somewhat like
a nested activity that can define its own layout and
manage its own lifecycle.

Communicating with Other Fragments

Get started

Dependencies and prerequisites


Basic knowledge of the Activity
lifecycle (see Managing the Activity
Lifecycle)
Experience building XML layouts

When a fragment specifies its own layout, it can be configured


Saving Data
Interacting with Other Apps

in different combinations with other fragments inside an activity

You should also read

to modify your layout configuration for different screen sizes (a

Fragments

small screen might show one fragment at a time, but a large

Supporting Tablets and Handsets

screen can show two or more).


Working with System Permissions

This class shows you how to create a dynamic user experience


Building Apps with
Content Sharing

with fragments and optimize your app's user experience for


devices with different screen sizes, all while continuing to

Try it out
DOWNLOAD THE SAMPLE
FragmentBasics.zip

Building Apps with

support devices running versions as old as Android 1.6.

Multimedia
Building Apps with
Graphics & Animation

Lessons
Creating a Fragment

Building Apps with


Connectivity & the Cloud
Building Apps with
Location & Maps

Learn how to build a fragment and implement basic behaviors within its callback methods.
Building a Flexible UI
Learn how to build your app with layouts that provide different fragment configurations for different

Building Apps with

screens.

User Info & Sign-In

Communicating with Other Fragments


Building Apps for
Wearables
Building Apps for
TV

Learn how to set up communication paths from a fragment to the activity and other fragments.
Get started

Building Apps for


Auto
Building Apps for
Work
Best Practices for
Interaction & Engagement
Best Practices for
User Interface

Get news & tips

Blog Support

Except as noted, this content is licensed under Creative Commons Attribution 2.5. For details and restrictions, see the Content

License.
Best Practices for
User Input
Best Practices for
Background Jobs
Best Practices for
Performance
Best Practices for
Security & Privacy
Best Practices for
Permissions & Identifiers
Best Practices for
Testing
Using Google Play to
Distribute & Monetize

About Android | Auto | TV | Wear | Legal

English

Das könnte Ihnen auch gefallen