際際滷

際際滷Share a Scribd company logo
Fragment
GDD Bootcamp 2011


                    1
?                  -              (uPhyca)

?   Blog : Y.A.M        (y-anz-m.blogspot.com)

?     : Android Layout Cookbook

?   Twitter : @yanzm

?   Android

?   GTUG Girls

                                                 2
Fragment




           3
Fragment




           4
Fragment




           5
6
★ layout-xlarge
                  7
8
...

<LinearLayout ...>
  <include layout= ̄@layout/main1 ̄/>
  <include layout= ̄@layout/main2 ̄/>
</LinearLayout>




 Activity




                                      9
Activity




+




           10
Fragment                       ...

                                            Fragment1    Fragment2
<LinearLayout ...>
  <fragment android:name= ̄...Fragment1 ̄/>         +            +
  <fragment android:name= ̄...Fragment2 ̄/>
</LinearLayout>




                                             Fragment1 Fragment2
Fragment                Activity
                                                  +        +



                                                                     11
2




    12
Fragment




           13
14
...

       View
                                    XML
                        URL


             Fragment

                              GET
-1     UI


- Activity
                                          15
... iosched


DashboardFragment




WhatsOnFragment


                     16
...

Activity

    onPause(), onResume()
    - IntentFilter   regist / unregist
    - ContentObserver      regist /unregist
    -




                                              17
...


-                               UI
    ★ Fragment   Fragment



     Fragment1
                    Fragment1   Fragment2




                                            18
...

Activity
- setContentView()   View


  ★ Fragment
    Fragment
  ★



                            19
...


Android 3.2       ActivityGroup, LocalActivityManager
deprecated
  ★ TabHost                Activity



- Fragment
- ActionBar.Tab

                                                        20
...

ListView + 1          View +     Adapter




                  ListFragment

     View         1




                                           21
Fragment




           22
Fragment   UI




                23
Activity - View


   Activity - Fragment - View


Fragment =                 +                 + View
                               Activity   View
                                             ...


                                                      24
View




       25
View
-        View    1   View
-


         View
-         View



-
          View

- View


                            26
View
Activity
                  Fragment




                             27
Fragment


?   View +

?   View



?   Activity

?




               28
Fragment



?   1   View   XML   <fragment>



?       View




                                  29
Fragment


?       View   XML
        ...

    ?




    ?




                     30
Fragment     3.0




v4 Support Library    1.6



                            31
View Activity
   Fragment




                32
?   View or               View

    ?




?   Fragment
    ?   View +      View                    View
        View

?   Activity
    ?              Activity      Fragment
               Fragment                      Window
               Activity

                                                      33
34

More Related Content

Fragment を聞ってみよう