Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic Fragments in Android

Is it possible to create fragments dynamically to generate a layout containing multiple fragments something like in a grid view. Currently, i m only able to load multiple fragments provided my layout has those number of fixed fragments.

like image 835
user874353 Avatar asked Dec 13 '11 08:12

user874353


1 Answers

Absolutely! Check out the Android Developers guide to Fragments. Be sure the see the second bullet point here, as well as the "Performing Fragment Transactions" section: http://developer.android.com/guide/topics/fundamentals/fragments.html#Adding

Additionally you can see your options for managing Fragments in this class: http://developer.android.com/reference/android/app/FragmentTransaction.html

like image 158
Taylor Clark Avatar answered Nov 12 '22 21:11

Taylor Clark