Android Horizontal LinearLayout - Wrap Elements [duplicate]
LinearLayout cant help with this. Instead you will have make your own Layout as mentioned in this http://nishantvnair.wordpress.com/2010/09/28/flowlayout-in-android/ or incorporate the same approach as of this Android - LinearLayout Horizontal with wrapping children
FlexboxLayout is a library project which brings the similar capabilities of CSS Flexible Box Layout Module to Android.
https://github.com/google/flexbox-layout
Similar question:
This project is nice because you can just add the Gradle compile directive for the project, and be able to use the FlowLayout in the Xml from there. No need to copy in Java files