Code example for GridView

Methods: setAdaptersetColumnWidthsetGravitysetHorizontalSpacingsetNumColumnssetStretchModesetVerticalSpacing, setId, setSoundEffectsEnabled

0
	private void initialise() { 
		textLabel = new TextView(this);
		drag = new ImageView(this);
		linearScroll = new LinearLayout(this);
		imageClear = new ImageView(this);
		tabGrid = new GridView(this);
		linearGrid = new LinearLayout(this);
		tabGrid.setId(123);
		linearInnerSroll = new LinearLayout(this);
		buttonBack = new Button(this);
		buttonHome = new Button(this);
		buttonBack.setMinimumWidth(45);
		buttonBack.setSoundEffectsEnabled(false);
		buttonHome.setSoundEffectsEnabled(false);
		tabGrid.setColumnWidth(65);
		tabGrid.setVerticalSpacing(1);
		tabGrid.setHorizontalSpacing(5);
		tabGrid.setNumColumns(-1);
		tabGrid.setGravity(0x11);
		tabGrid.setStretchMode(1);
		tabGrid.setSoundEffectsEnabled(false);
		View m_vForm;
		populateGrid(); 
		m_vForm = createUI();
 
		setContentView(m_vForm);
		 
		setButtonControls(); 
		setTextControls(); 
		setImages(); 
		checkDialogIntegrity(); 
		new Handler().postDelayed(new Runnable() {
			public void run() { 
				linearInnerSroll.setMinimumWidth(display.getWidth() -imageClear.getWidth() );
			} 
		}, 850L); 
 
	} 
 
	private void setImages() { 
		if(index==-1)
			return; 
		else { 
			String temp[];
			for(int i=0;i<rowList.size();i++) {
 
				temp = rowList.get(i);
				addThumb(temp[0],Integer.parseInt(temp[1]),i,false);
 
			} 
			scrollView(); 
		} 
	} 
 
	private void populateGrid() { 
 
		boolean exception = false;
		try { 
			tabGrid.setAdapter(new ImageAdapter(this,path,0));
		}  
 
		catch (IOException e) {
			// TODO Auto-generated catch block 
			exception=true;