I always read about this funny weight value in the Android documentations. Now I want to try it for the first time but it isn\'t working at all.
As I understand it
Below are the changes (Marked in BOLD) in your code:
//changes made here
//changes made here
Since your LinearLayout has orientation as horizontal, therefore you will need to keep your width only as 0dp. for using weights in that direction . (If your orientation was vertical, you would have kept your height only 0dp).
Since there are 2 views and you have placed android:layout_weight="1" for both the views, it means it will divide the two views equally in horizontal direction (or by width).