As a requirement, I need to click an item only for zig zag position for gridview.
gridView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View v,
int position, long id) {
if (position% 2 == 0) {//0 even 1 odd..
}
}
This provides me for even items to click. How to get items in zig zag position?
0 1
2 3
4 5
6 7
means in zig zag maaner 0,3,4,7 and so on position..
I couldn't get any idea how to proceed.
Thanks