I have a textview in my app that contains numbers and letters and what I want to do is only get the numbers from it and apply a if statement. Something along the lines of;
if (number == 1) {
// do something
} else if (number == 2) {
// do something
} else if (number >= 8) {
// do something
}
I have declared my textview like this;
TextView textview = (TextView) findViewById(R.id.number);
and the textview will contain texts similar to theses
textview.setText("1\nperson");
textview.setText("2\nperson");
textview.setText("3\nperson");
....
....
....
What I want to do is only get the text and then use the if statement shown below to carry out a task depending on the number. Any help would be nice.