Understanding Android Layout : Linear Layout

In the last tutorial we have seen the life-cycle of the Android Application . Every Android Activity
will have a set of life cycle methods that will be called based on the state of the Application .
The onCreate(Bundle)is where you will initialize your activity , this is where you will be setting
the content of the Activity using the setContentView(Layout Resource) method.

So we will be covering different type of Layouts in this set of tutorial . Lets start with the most
easy and commonly used layout LinearLayout .

3. Horizontal Linear Layout : Layout_Weight example

As we can see the third button is out of the screen bounds . A more flexible way of setting

the width in the horizontal linear layout would be to use the layout_weight . The most important
thing to notice while playing around with layout_weight is that to set the (layout_width orlayout_height) to be set to 0dp depending on whether you are going to divide the space
horizontally or vertically . In our case we will be setting the layout_width = 0since we
are dividing the horizontal space .