Code example for ImageSwitcher

Methods: setImageResource

0
     
    private OnItemSelectedListener myGalleryOnItemSelectedListener
     	= new OnItemSelectedListener(){ 
    	public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) { 
    		// TODO Auto-generated method stub 
    		myImageSwitcher.setImageResource(mThumbIds[arg2]); 
    	} 
    	public void onNothingSelected(AdapterView<?> arg0) { 
    		// TODO Auto-generated method stub 
    	} 
    }; 
     
    private Integer[] mThumbIds = {
            R.drawable.like, 
            R.drawable.share, 
            R.drawable.jdownloader, 
            R.drawable.icon, 
            R.drawable.textedit 
          }; 
     
    public class ImageAdapter extends BaseAdapter{