2

I need to implement this layout in my project. The sliding drawer works fine for me instead of, when i have customized the slidemenu.xml of com.coboltforge.slidemenuexample it stops working. Once the drawer has been set as shown by cliking the action button from ActionBar it remains open & doesn't get closed. What i want to do is "open an another activity without fragment in onClick event of imageView1"? I don't know how to do this. Any help would be appreciated.

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <View 
        android:layout_width="250dp"
        android:layout_height="1dp"
        android:background="#a8a8a8" />

    <RelativeLayout
        android:layout_width="250dp"
        android:layout_height="48dp"
        android:paddingRight="15dp"
        android:paddingLeft="20dp"
        android:background="#000000" >

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:layout_centerVertical="true"
            android:textStyle="bold"
            android:textColor="#ffffff"
            android:text="Demo Mode" />

        <View 
            android:layout_width="1dp"
            android:layout_height="fill_parent"
            android:layout_marginLeft="20dp"
            android:layout_toLeftOf="@+id/imageView1"
            android:background="#a8a8a8" />

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:src="@drawable/settings_icon"
            android:layout_marginLeft="15dp"
            android:contentDescription="@null" />

    </RelativeLayout>

    <View 
        android:layout_width="250dp"
        android:layout_height="1dp"
        android:background="#a8a8a8" />

    <View 
        android:layout_width="250dp"
        android:layout_height="20dp"
        android:background="#000000" />

    <LinearLayout
        android:layout_width="250dip"
        android:layout_height="fill_parent"
        android:orientation="vertical" >

        <ListView
            android:id="@+id/menu_listview"
            android:layout_width="fill_parent"
            android:layout_height="match_parent"            
            android:divider="@android:color/darker_gray"            
            android:dividerHeight="1dip"
            android:background="#000000" />

    </LinearLayout>

    <FrameLayout
        android:id="@+id/overlay"        
        android:layout_width="match_parent"
        android:layout_height="match_parent" >
    </FrameLayout>

</LinearLayout>

1 Answers1

0

I have simply attach a clickable and an onClick(to call a method to open an activity) attribute to ImageView in its xml layout & it worked smoothly for me. Previously i have tried attaching onClickListener from java file & it doesn't work for me.

<ImageView
                android:id="@+id/imageView1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:src="@drawable/settings_icon"
                android:layout_marginLeft="15dp"
                android:clickable="true"
                android:onClick="openSettingsIconActivity"
                android:contentDescription="@null" />