Dynamic snippets in Android

Is it possible to create fragments dynamically to create a layout containing several fragments, something like a grid view. Currently, I can only load a few fragments if there are so many fixed fragments in my layout.

+6
source share
1 answer

Absolutely! Check out the Android Developer Guide for snippets. Make sure that there is a second marker point, as well as a section called “Performing Fragmentation”: http://developer.android.com/guide/topics/fundamentals/fragments.html#Adding

Additionally, you can see your fragment control options in this class: http://developer.android.com/reference/android/app/FragmentTransaction.html

+3
source

Source: https://habr.com/ru/post/903659/


All Articles