android - Unable to add text to dynamic radiobuttons -


i trying add dynamic radio buttons , text string array. able add radiobuttons of same array length of "application" text not displayed..any idea?

private string[] application = {"abc", "def", "ghi", "jkl"}; radiobutton[] rb = null;      radiogroup = (radiogroup) mlinearview3.findviewbyid(r.id.myradiogroup); rb = new radiobutton[application.length];  for(int m = 0; m < application.length; m++) {     rb[m] = new radiobutton(getapplicationcontext());     rb[m].settext(application[m]);     rb[m].setid(m);     radiogroup.addview(rb[m]);            }  mlinearscrollthird.addview(mlinearview3); 

layout.xml

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:background="@android:color/white"     android:orientation="vertical">      <radiogroup          android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_below="@+id/text"         android:id="@+id/myradiogroup"         android:background="#fff"         android:checkedbutton="@+id/sound">      </radiogroup>      <view         android:layout_width="match_parent"         android:layout_height="1dp"         android:background="@android:color/darker_gray"/>  </linearlayout> 

go link think understand have do

add radio button dynamically : android


Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -