Is it possible to stop getting negative numbers in TextView in android by writing a code in java.
I tried this
int up = 0;
TextView textview;
if (allowNagativeNumbers == false) {
if ( up < 0 )
{
up = 0;
textview.setText(0);
}
}
but it still allows negative numbers. I am not sure if this code is right but by this code I mean everytime the value for up / text in textview is less then 0 e.g. -1 then change the value of up to 0 and make the textview text 0.