Code example for Gallery

Methods: getAdapter

0
 
		gallery.setOnItemSelectedListener(new OnItemSelectedListener() {
			public void onItemSelected(AdapterView<?> parent, View view,
					int position, long id) {
				System.gc();
				imageView.setImageResource((Integer) gallery.getAdapter()
						.getItem(position));
			} 
 
			public void onNothingSelected(AdapterView<?> parent) {
			} 
		}); 
	} 
 
	public void onClick(DialogInterface dialog, int which) {
		switch (which) {
		case DialogInterface.BUTTON_NEUTRAL:
			dialog.dismiss();
			finish();
		} 
	}