how to have 2 relative layouts devided by half in activity? : i want to devide my screen in half vertically, and do a diffrent color in each half, 

i was trying to use this sulotion mentioned in here> 

http://stackoverflow.com/questions/19983335/android-2-relative-layout-divided-in-half-screen

but it doesn't work for me.

this is my layout:


    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:baselineAligned="false"
        android:orientation="horizontal"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        tools:context=".activities.alignmentActivities.Add_New_Project_Activity"
        tools:showIn="@layout/app_bar_add__new__project_">
    
    
            <RelativeLayout
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:background="#f00000"
                android:layout_weight="1">
            </RelativeLayout>
    
            <RelativeLayout
                android:layout_width="0dp"
                android:background="#00b0f0"
                android:layout_height="wrap_content"
                android:layout_weight="1">
            </RelativeLayout>
    
    </LinearLayout>


how can i achieve the desired effect of 2 layouts each takes half the screen vertical \ what am i doing wrong then the example mentioned in the link ?

