Need to Dynamically Set Radio Button horizontaly in a layout :android

I need to set the radio button dynamically in layout , but when i am adding it horizontally then it would be able to display radio button in a single row so my all radio button are not visible , i need to set rest radio button below to above radio button , means All button should be visible in Horizontally with text besides Left hand side of Radio button.. my code is below , but it showing radio button in a single row so all radio button are not visible..

main.xml

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
android:orientation="vertical" >

<TextView
    android:id="@+id/TextView01"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Choose Your Favorite Actress" >
</TextView>

<RadioGroup
    android:id="@+id/RadioGroup01"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" >
</RadioGroup>
<Button
    android:id="@+id/Button01"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Submit" >
</Button>

 </LinearLayout>

and java class is :

 @Override
public void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);


    DisplayRadioButton();

}


public void DisplayRadioButton()
{
    for(int i=0;i<10;i++)
    {
        RadioGroup radiogroup = (RadioGroup)findViewById(R.id.RadioGroup01);
        RadioButton rdbtn = new RadioButton(this);
        rdbtn.setId(i);
        rdbtn.setText(text[i]);
        radiogroup.addView(rdbtn);
    }

}

Answers


radgroup.layout(l, t, r, b); left top right bottom positions


Need Your Help

Any way of using frames in HTML5?

html5 frames

For school I must make a website and it must use those crappy old damn fml frames. I've already complained about this to my teacher without any success :(

Can the POJO corresponding to JSON structure be null in Jackson?

java json jackson

I am using jackson-annotations 2.4 and related jars to covert from JSON to POJO. Let's say I have a structure as follows in my json: