Code example for Gallery

Methods: setAdapter, setSelection

0
			gallery = (Gallery) findViewById(R.id.gallery_zimu);
		}; 
        public void setURLManager(URLManager urlManager){
        	if(urlManager == null)return;
        	definationStrings = urlManager.getExitQualityList();
        	gallery.setAdapter(new QuaSubAdapter(definationStrings));
        	gallery.setSelection(definationStrings.indexOf(URLManager.getQualityString(urlManager.getCurrentQuality())));
        }		 
	} 
	 
	class QuaSubAdapter extends BaseAdapter{
		private ArrayList<String> StringResource = new ArrayList<String>();
		public QuaSubAdapter(ArrayList<String> list){
			if(list == null)return;
			StringResource.clear();
			StringResource = list;
//			this.notify(); 
		} 
		@Override 
		public int getCount() { 
			// TODO Auto-generated method stub