android:layout_gravity
is used for the layout itself
Use android:gravity="center"
for children of your LinearLayout
So your code should be:
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_weight="1" >