Next, I'm having a problem getting the value in an EditText and displaying it in a TextView. The value displayed when using a string, is "null", and when using int, it is 0. I believe this happens because the value being collected, is what appears before the typed, ie nothing!
I would like to know if there is any way to monitor the value entered in EditText so that when it is changed, the button will pick up the new value, not the previous one if that is the problem.
Thecodefortheclassresponsibleforthecalculationis here .
Edit: Just call the method within the Click event of the button.
btnCalc = (Button)findViewById(R.id.btnCalc);
btnCalc.setOnClickListener (new View.OnClickListener()
{
public void onClick(View v)
{
Calculate(); //este método
result = "#" + rst1 + remainderR + rst2 + remainderG + rst3 + remainderB;
txtResult.setText(result);
}
});