I have 3 radiobuttons in my app and I am getting the ID of the selected one like this:

```
  int selectedId = radioGroup.getCheckedRadioButtonId();

```

And then in my if condition I compared it:

```
  if( selectedId == 2131230992  { do something...}
 else if( selectedId == 2131230993{ do something...}
else {...}

```

However this was working very well, but suddenly I noticed in my live app, that the radiobuttons doesn't work anymore.

I debugged it and found out, that when I log the value of radiobuttons ID, it is now different as before.

```
Log.e("ID", String.valueOf(selectedId));

```

Now it is 2131231081, 2131231081, 2131231083 etc.

How are these ID changing and why? During my app build these ID's were fixed numbers, so I used them in my conditions, but now there are totally different ID's.

So what should be the correct way to check which radiobutton is selected, if the ID's can't be used this way?