Code example for Gallery

Methods: setSelection

0
    mListView.setOnItemClickListener(new OnItemClickListener() {
 
      @Override 
      public void onItemClick(AdapterView<?> parent, View view,
          int position, long id) {
        mGallery.setSelection(position - 1, true);
      } 
    }); 
  } 
}