put element in the middle of linearlayout android 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