Get the position of the current image displayed in Gallery
in my application , i have a gallery of pictures, but i want to detect the position of the current image displayed , For example : when i launch my acvitivity, the position is 0, but when i scroll in my gallery,i want to get The position of the Current image displayed , i have tried OnFocusChanged , OnItemClicked , but that works only if i click on an item of my gallery Any ideas ! :( gal.setOnItemSelectedListener(new OnItemSelectedListener(){ @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { //Do something with position } }; You get this callback