Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Fragments - why are they so useful?

I heard a lot of recommendation to use fragments in activities, but why is that? I know that fragments can be used when composing screen layouts for small and large device's screens. Is there something more for what can be fragments useful? Can they automatically save and restore state when rotating? Or something else?

like image 478
Incredible Avatar asked Dec 19 '25 03:12

Incredible


1 Answers

You should read a little bit more about fragments, here : http://developer.android.com/reference/android/support/v4/app/FragmentActivity.html

You can also look at the available methods so it is clearer what you can do, but I personally don't use fragments in simple apps, event for tablets, do fragments are like "divs" from html, they are just blocks/containers

like image 74
Кристиян Кацаров Avatar answered Dec 21 '25 18:12

Кристиян Кацаров