Code example for TableLayout

Methods: setBackgroundColoraddView

0
		Bundle extras = getIntent().getExtras();
		if (extras != null) {
			text = extras.getString("text");
		} 
 
		TableLayout tableLayout = new TableLayout(this);
		tableLayout.setBackgroundColor(Color.rgb(255, 255, 255));
		setContentView(tableLayout, new LayoutParams(LayoutParams.FILL_PARENT,
				LayoutParams.FILL_PARENT));
 
		TableRow tableRow1 = new TableRow(this);
		shopName = new EditText(this);
		shopName.setText("", EditText.BufferType.NORMAL);
		tableRow1.addView(shopName);
 
		TableRow tableRow2 = new TableRow(this);
		RadioButton rd0 = new RadioButton(this);
		rd0.setId(0);
		rd0.setText("�����N�P");
		rd0.setTextColor(Color.rgb(0, 0, 0));
 
		RadioButton rd1 = new RadioButton(this);
		rd1.setId(1);
		rd1.setText("�����N2");
		rd1.setTextColor(Color.rgb(0, 0, 0));
 
		categoryRadio = new RadioGroup(this);
		categoryRadio.addView(rd0);
		categoryRadio.addView(rd1);
		categoryRadio.check(0);
		tableRow2.addView(categoryRadio);
 
		// ���e�{�^���̐��� 
		TableRow tableRow3 = new TableRow(this);
		cntrbtBtn = new Button(this);
		cntrbtBtn.setText("���e");
		cntrbtBtn.setOnClickListener(this);
		cntrbtBtn.setTag("cntrbt");
		tableRow3.addView(cntrbtBtn);
 
		// ���� 
		TableRow tableRow4 = new TableRow(this);
		searchText = new EditText(this);
		searchText.setText("���񕶎�", EditText.BufferType.NORMAL);
		tableRow4.addView(searchText);
 
		searchBtn = new Button(this);
		searchBtn.setText("����");
		searchBtn.setOnClickListener(this);
		searchBtn.setTag("search");
		tableRow4.addView(searchBtn);
 
		// �n�} 
		TableRow tableRow5 = new TableRow(this);
		mapBtn = new Button(this);
		mapBtn.setText("�n�}");
		mapBtn.setOnClickListener(this);
		mapBtn.setTag("map");
		tableRow5.addView(mapBtn);
 
		// �t�@�C�� 
		TableRow tableRow6 = new TableRow(this);
		fileBtn = new Button(this);
		fileBtn.setText("�摜");
		fileBtn.setOnClickListener(this);
		fileBtn.setTag("file");
		tableRow6.addView(fileBtn);
 
		// �摜�t�@�C�� 
		imgFileText = new EditText(this);
		imgFileText.setText("", EditText.BufferType.NORMAL);
		tableRow6.addView(imgFileText);
 
		// �J���� 
		TableRow tableRow7 = new TableRow(this);
		cameraBtn = new Button(this);
		cameraBtn.setText("�J����");
		cameraBtn.setOnClickListener(this);
		cameraBtn.setTag("camera");
		tableRow7.addView(cameraBtn);
 
        tableLayout.addView(tableRow1);
        tableLayout.addView(tableRow2);
        tableLayout.addView(tableRow3);
        tableLayout.addView(tableRow4);
        tableLayout.addView(tableRow5);
        tableLayout.addView(tableRow6);
        tableLayout.addView(tableRow7);
		 
	} 
 
	protected void onActivityResult(int requestCode, int resultCode,
			Intent intent) {