Code example for ImageSwitcher

Methods: setImageURI, setInAnimation, setOutAnimation

0
			@Override 
			public void onItemClick(AdapterView<?> arg0, View arg1, int position,
					long id) {	
				System.out.println("this is on gallery on clicklistener");
				cur.moveToPosition(position);
				ims.setInAnimation(AnimationUtils.loadAnimation(ImageSwitcherActivity.this, android.R.anim.slide_in_left));
				ims.setOutAnimation(AnimationUtils.loadAnimation(ImageSwitcherActivity.this, android.R.anim.fade_out));
				ims.setImageURI(Uri.withAppendedPath(uri, ""+cur.getInt(columnIndex)));				
			} 
		}); 
		 
		cur.moveToFirst();
		ims.setImageURI(Uri.withAppendedPath(uri, ""+cur.getInt(columnIndex)));
		 
	} 
 
	public void play(View v){
		Intent i = new Intent(getApplicationContext(), PresentationActivity.class);
		startActivity(i);
		 
	}