I'm using radio group but RadioGroup
onClick
event is not firing and
the method getCheckedRadiobuttonID()
is returning null
. Here is the element in my layout:
<RadioGroup
android:id="@+id/RG1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:onClick="onRGClick" >
Method
public void onRGClick(View v) {
Toast.makeText(this, "Test ", 1000).show();
}
Best Solution
This problem can be solved using the following
Alternatively
You can use custom ids rather than default one