Tag Archives: RadioGroup

27,896 views

Create RadioButton RadioGroup dynamically – Android sample

public class MainActivity extends Activity implements OnClickListener {   @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);   LinearLayout layout = (LinearLayout) findViewById(R.id.layout); RadioGroup radioGroup = new RadioGroup(this);   LinearLayout.LayoutParams p = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT ); layout.addView(radioGroup, p);   … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on Create RadioButton RadioGroup dynamically – Android sample
9,812 views

Android RadioGroup alignment like TableLayout

xml example source code with image. <TableLayout android:layout_width="match_parent" android:id="@+id/idTableInRadioGroup" android:layout_height="wrap_content"> <TableRow android:id="@+id/tableRow1" android:layout_width="wrap_content" android:layout_height="wrap_content">     <RadioGroup android:id="@+id/idRadio_group_1_column" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:orientation="vertical"> <RadioButton android:id="@+id/idRadio_1" android:text="@string/textLabel_1"/> <RadioButton android:id="@+id/idRadio_2" android:text="@string/textLabel_2"/> <RadioButton android:id="@+id/idRadio_3" android:text="@string/textLabel_3"/>   </RadioGroup> <RadioGroup android:id="@+id/idRadio_group_2_column" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:orientation="vertical">   … Continue reading

Posted in Android Examples Code | Tagged , , , | Comments Off on Android RadioGroup alignment like TableLayout
16,566 views

RadioButton RadioGroup Java Android example

RadioButton RadioGroup Android example source code for Android developer Example for *.xml files <RadioGroup android:id="@+id/idRadio_group" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:orientation="vertical">   <RadioButton android:id="@+id/idRadio_1" android:text="@string/textLabel_1"/> <RadioButton android:id="@+id/idRadio_2" android:text="@string/textLabel_2"/> <RadioButton android:id="@+id/idRadio_3" android:text="@string/textLabel_3"/>   </RadioGroup> Example for *.java files // import import android.widget.RadioGroup; // … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on RadioButton RadioGroup Java Android example