I am developing an app for in which i am using Grid Layout to arrange TextViews. TextViews are added dynamically.
now what i want is when user clicks on any click listener , a toast should be popped up giving position of textview in terms of row and column number. ( i am also using column spanning).
till now i have implemented click listener on textView but i am not able to figure out how i can get its position to show in toast.
Grid Layout is added in a Horizontal ScrollView which in turn is added into a Scroll View , i need this setup to get scrolling in both direction.
my layout XML :-
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/vertical_scroll_view3">
<HorizontalScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/horizontal_scroll_view3">
<GridLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="@+id/gridLayout"
android:orientation="vertical"
/>
</HorizontalScrollView>
</ScrollView>
i am following following question to add view dynamically
How to make a GridLayout fit screen size
my gridlayout is :-
and its Grid Layout not Grid View !!
Any suggestion is appreciated !!