I am using a listview and slidingdrawer in an activity. My intention is to open the slidingdrawer and display the content upon list item click. slidingdrawer content will be changed depending on the item selected.
The UI layout is shown as follows.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ListView
android:id="@+id/presentation_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</ListView>
<SlidingDrawer
android:id="@+id/slidingDrawer1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:content="@+id/content"
android:handle="@+id/handle"
android:orientation="horizontal" >
<Button
android:id="@+id/handle"
android:layout_width="40dp"
android:layout_height="fill_parent"
android:background="@android:color/darker_gray" />
<LinearLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Presentation's Images.. Please Flip"
android:textColor="@android:color/black"
android:textStyle="bold" />
<ImageView
android:id="@+id/content_imageview"
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="@android:color/black"
android:layout_below="@id/presentation_list"
/>
</LinearLayout>
</SlidingDrawer>
I click on the listview slider opens up, when i click on the slidingdrawer’s imageview my listview is also getting clicked. The control gets to the listview item click method and image gets changed
Can anyone help me in rectifying the issue ?
Add
android:clickableattribute to yourcontentlayout and set it to betrue:Unfortunately, I cannot explain why it happens.