I need to set validation that user must fill / select all details in a page. If any fields are empty wanna show Toast message to fill. Now I need set validation
My answer is according to the documentation, which works fine.
1) In xml file include android:onClick="onRadioButtonClicked" as shown below:
2) In Java file implement onRadioButtonClicked method outside onCreate() method as shown below:
public void onRadioButtonClicked(View view) {
// Is the button now checked?
boolean checked = ((RadioButton) view).isChecked();
// Check which radio button was clicked
switch(view.getId()) {
case R.id.b1:
if (checked)
{
Log.e("b1", "b1" );
break;
}
case R.id.b2:
if (checked)
break;
}
}