I want to detect the gallery view slide to next item in Android like if gallery view current index is 0 if slide the gallery view to next image i want to detect this event item change listener on slide event in android!I have no idea for this concept pls help me any one Thanks!
Asked
Active
Viewed 2,892 times
2
-
Nice user name you got there :) .. are you looking for onItemchangedListener? – Andro Selva Jul 17 '12 at 11:43
-
i want to detect event the gallery view slide to current item to next item how to do this? – Stack Overflow User Jul 17 '12 at 11:45
2 Answers
8
I found my answer. Using setOnItemSelectedListener
slide or keypress it is easy to find current item focused:
g.setOnItemSelectedListener( new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> arg0, View arg1, int pos, long arg3) {
Log.v("Changed----->", ""+pos);
change_position=pos;
}
public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub
}
});

Chilledrat
- 2,593
- 3
- 28
- 38

Stack Overflow User
- 4,052
- 6
- 29
- 47
0
For that Purpose you needs To create a custom gallery and override onFling() method of GestureDetector class. and in that method you can easily detect your view sliding directions.

Arun Joshi
- 170
- 1
- 1
- 10