RadioGroup setOnCheckedChangeListener getting call multiple times during initialization in Android

20 Dec
mRadioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
    private boolean isChecked(RadioGroup group, int viewId) {
        if (viewId != -1) {
            View v = group.findViewById(viewId);
            if (v instanceof RadioButton) {
                return ((RadioButton) v).isChecked();
        return true;

    public void onCheckedChanged(RadioGroup group, int checkedId) {
        if (!isChecked(group, checkedId)) {
        // put your code here
Leave a comment

Posted by on December 20, 2014 in Android Source Code


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: