if you are trying something not to "connect to each other", that is, you need some space between the two widgets, then use an empty widget and use the scales
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:weightSum="100" > <TextView android:layout_width="100dp" android:layout_height="200dp" android:layout_weight="40" android:gravity="center_vertical" android:text="layout_gravity=top gravity=center_vertical" > </TextView> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="20" /> <TextView android:layout_width="100dp" android:layout_height="200dp" android:layout_weight="40" android:gravity="right" android:text="layout_gravity=top gravity=top" > </TextView> </LinearLayout>

You did not know what you wanted, this is what I could interpret as your desired conclusion. But I will explain to you how it works. For more information on weights, you can go to http://developer.android.com/reference/android/widget/package-summary.html
There is something called “widget” and “widget content”. Speaking of linearlayout with layout_gravity, you set its gravity as a “widget” in the main view, and using gravity you set gravity on the content in this linear mode
It is symbolic with the textview expression, if you use layout_gravity (for example, equal to the center), then the text image will be centered in its space (that is, it will be centered in width if the orientation of the layout is vertical, and it will be centered in height if the layout_orientation is horizontal )
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal"> <TextView android:layout_width="200dp" android:layout_height="200dp" android:layout_gravity="center" android:text="Second Activity" /> </LinearLayout>

See the same in vertical orientation.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <TextView android:layout_width="200dp" android:layout_height="200dp" android:layout_gravity="center" android:text="Second Activity" /> </LinearLayout>

Also now look at gravity, when you apply gravity to a texture, TEXT is centered in the text view (if gravity = center)
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <TextView android:layout_width="200dp" android:layout_height="200dp" android:layout_gravity="center" **android:gravity="center"** android:text="Second Activity" /> </LinearLayout>

Now you can understand that gravity sets the gravity for the content inside the widget. The "content" of a widget may be widgets themselves. LinearLayout is a widget, and in the linear layout you add other types of widgets (button and text view) Thus, applying the gravity = center to textview method sets its content (i.e. text) in the center and applying gravity to the linearlayout will center it content (i.e. Textview) in the center
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:gravity="center"> <TextView android:layout_width="200dp" android:layout_height="200dp" android:layout_gravity="center" android:gravity="center" android:text="Second Activity" /> </LinearLayout>
