I'm clueless right now. I'm working on my project and I got some references for some part of my project and while I was trying my best to understand the code. I just can't seem to understand 1 part of it which doesn't allow me to proceed.
I hope someone kind enough can help me out and give me an explanation on this issue.
Anyone can explain to me about the part positionData = (byte) (checkedId - position1Button.getId());
What is the real purpose of this? I don't understand why it has a minus sign there and also how does the (byte) thingy works.
I hope someone kind enough can help me out and give me an explanation on this issue.
Anyone can explain to me about the part positionData = (byte) (checkedId - position1Button.getId());
What is the real purpose of this? I don't understand why it has a minus sign there and also how does the (byte) thingy works.
Code:
private byte positionData;
class PositionRadioGroupListener implements android.widget.RadioGroup.OnCheckedChangeListener{
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
positionData=(byte) (checkedId - position1Button.getId());
imageChange();
}//onCheckedChanged
}
