-1

I have 5 buttons inside a LinearLayout .

My problem is simultaneous touch on the Left most & Right most button triggers the Middle Button .

I have tried

android:splitMotionEvents="false"
android:windowEnableSplitTouch="false"

and unfortunately nothing works. What should i do ? .

My XML snippet is

     <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:splitMotionEvents="false"
        android:windowEnableSplitTouch="false" >

        <Button
            android:id="@+id/someText1"
            style="@style/ButtonStyle"
            android:layout_marginRight="10dp"
            android:onClick="someText1"
            android:text="someText1" />

        <Button
            android:id="@+id/someText2"
            style="@style/ButtonStyle"
            android:layout_marginRight="10dp"
            android:enabled="false"
            android:onClick="someText2"
            android:text="someText2" />

        <Button
            android:id="@+id/someText3"
            style="@style/ButtonStyle"
            android:layout_marginRight="10dp"
            android:onClick="someText3"
            android:text="someText3" />
        <Button
            android:id="@+id/someText4"
            style="@style/ButtonStyle"
            android:layout_marginRight="10dp"
            android:onClick="someText4"
            android:text="someText4" />

        <Button
            android:id="@+id/someText5"
            style="@style/ButtonStyle"
            android:layout_marginRight="10dp"
            android:onClick="someText5"
            android:text="someText5" />

        <Button
            android:id="@+id/someText6"
            style="@style/ButtonStyle"
            android:onClick="someText6"
            android:text="someText6" />
    </LinearLayout>

If it have no direct solution , is there any work-around ?

Note : I am working on Android JellyBean4.1.2

Lot of thanks in advance .

Don Chakkappan
  • 7,397
  • 5
  • 44
  • 59

2 Answers2

0

I don't know if its works or not

Just Try to set OnClick listeners dynamically in your java code

like

button1.setOnCllickListener(onclicklistenerobject);
Jitty Aandyan
  • 1,994
  • 1
  • 13
  • 12
0

I assume that it's not possible to push several stock buttons (android.widget.button) at a time.

You can implement your own buttons or maybe detect multi touch on parent widget and check if touch position is on the button.

Kirill Volkov
  • 942
  • 1
  • 9
  • 18