What is the difference between linear and relative layout?
One of the characteristic feature of LinearLayout in Android is use of a property called Weight, which app can specify using android:layout_weight.
This attribute assigns an "importance" value to a view in terms of how much space it should occupy on the screen.
On the other hand, RelativeLayout do not support weight or in other words, RelativeLayout does not pay attention to android:layout_weight. That's a property of LinearLayout.LayoutParams, but not of RelativeLayout.LayoutParams.