Code example for Gallery

Methods: getSelectedItemPosition

0
    public void onNothingSelected(AdapterView parent) {
    } 
     
    @Override 
    public boolean onTouchEvent(MotionEvent event) {
        selectWallpaper(mGallery.getSelectedItemPosition());
        return true; 
    } 
 
    public class ImageAdapter extends BaseAdapter {
 
        private Context mContext;
         
        public ImageAdapter(Context c) {
            mContext = c;
        } 
 
        public int getCount() { 
            return THUMB_IDS.length;
        }