I saw this link and answer of bakwarte. Center two buttons horizontally
Toni Gamez said, This is for API >= 14.
I tried and saw that it works for level 10, for example. So could this be the right way for all API levels?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_margin="10dp">
<Space
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1" />
<ImageView
android:id="@+id/imageView1"
android:background="@drawable/Icon"
android:layout_width="100dp"
android:layout_height="wrap_content" />
<Space
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>