This is my xml :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="top"
android:rotation="180">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center"
android:id="@+id/cols">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/col1">
<Button .../>
<Button .../>
<Button .../>
<Button .../>
<Button .../>
<Button .../>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/col2">
<Button .../>
<Button .../>
<Button .../>
<Button .../>
<Button .../>
<Button .../>
</LinearLayout>
</LinearLayout>
</LinearLayout>
I want click listener on the all buttons and I want to have the position when I click on a button. I tried several things without success.Indeed, I can't to have the clicked button position.