問題:
In my layout I have defined something like this .在我的佈局中,我定義了這樣的東西。
<RadioButton
android:id="@+id/radio1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Dnt want this text" />
Assume that some function in activity returns me this id (id of radioButton).假設活動中的某個函數向我返回這個 id(radioButton 的 id)。 Now i want to get this text radio1 from this id.現在我想從這個 id 獲取這個文本radio1 。 In short I want to retrieve text radio1 written in android:id="@+id/radio1"
總之,我想檢索用android:id="@+id/radio1"
編寫的文本radio1
Can somebody tell me how is it possible ?有人能告訴我怎麼可能嗎?
解決方案:
參考一: https://en.stackoom.com/question/gXHA參考二: https://stackoom.com/question/gXHA