FrameLayout to RelativeLayout ClassCastException even if there is no FrameLayout used
===

In my application, I have a layout which has a `RelativeLayout` to which I want to set margins at runtime programmatically. But when I do that, it gives me `ClassCastException` saying `FrameLayout` can not cast to `RelativeLayout`. I don't have any FrameLayout used, also there are no imports for `FrameLayout`. Still the problem persists. The xml I am using is:

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/rl_root"
    android:background="@color/menu_bg"
    android:layout_width="wrap_content"
    android:layout_height="fill_parent" >

    <RelativeLayout
        android:id="@+id/ll_lhs_menu"
        android:layout_width="300dip"
        android:layout_height="fill_parent"
        android:background="@color/menu_bg"
        android:orientation="vertical">
        
        .....
        
    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/rl_right"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentRight="true"
        android:background="@drawable/capture_port"
        android:scrollbars="none" >
        
        ....
        
    </RelativeLayout>

    </RelativeLayout>

And this is my onCreate where I set the margins to the parent layout:

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.menu);
	
	RelativeLayout.LayoutParams _rootLayoutParams = new RelativeLayout.LayoutParams(_rootLayout.getWidth(), _rootLayout.getHeight());
	_rootLayoutParams.setMargins(300, 0, 300, 0);
	_rootLayout.setLayoutParams(_rootLayoutParams);
    }

Where am I going wrong?