2016-08-17 4 views
2

Я хочу отредактировать текст кнопки «Радио» после успешного запуска приложения на устройстве. Могу ли я достичь этого?Могу ли я редактировать текст кнопки радиотекста?

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" > 

<RadioGroup 
    android:id="@+id/radioGroup1" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginLeft="10dp" 
    android:layout_marginRight="10dp" 
    android:layout_marginTop="10dp" 
    android:orientation="horizontal" 
    android:weightSum="2" > 

    <RadioButton 
     android:id="@+id/radio0" 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_weight="1" 
     android:text="call" /> 

    <RadioButton 
     android:id="@+id/radio1" 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_weight="1" 
     android:checked="true" 
     android:text="email" /> 
</RadioGroup> 

Так изначально Моя кнопка радио называется вызов и email.So, когда я запускаю это мне нужно, чтобы быть доступным для редактирования.

ответ

0

использовать это
- RadioButton rb = (RadioButton) findViewById (R.id.rbMyAvatars);

  • rb.setText ("dfjhdfssdf");