linearlayout center code example
Example 1: linear layout element to center
android:gravity="center"
Example 2: how to center all elements in a linearlayout
android:gravity takes care of its children,
android:layout_gravity takes care of itself
android:gravity="center"
android:gravity takes care of its children,
android:layout_gravity takes care of itself