Articles

Affichage des articles associés au libellé Fragment

Android tutorial : Using Fragments to divide the screen into multiple Activity

Image
Android API version 3.0, known as Honeycomb, introduced a new concept called "Fragment". A Fragment is an independent component which can be connected to an activity.  A Fragment typically defines a part of a user interface but it is possible to define  headless Fragments, i.e. without user interface. It represents a behavior or a portion of user interface in an Activity. Fragment Lifecycle   A fragment is always connected to an activity.     onAttach()    is called when the Fragment instance is associated with an Activity instance. This does not mean the Activity is fully initialized. onCreate() The system calls this when creating the fragment. onCreateView() The system calls this when it's time for the fragment to draw its user interface for the first time.  Here you can inflate a layout via the inflate() method call of   the Inflator object passed as a parameter to this method. There is no need to implement this method for headlessfragments. onPau