I\'m trying to create a for
-loop to add views to a layout. The for
-loop is working fine (I tried it with initialized variables) but I need to get an in
bez you are passing empty String in parseInt() so check before parsing string to int as:
EditText numSensors = (EditText) findViewById(R.id.num_sensors);
String change = numSensors.getText().toString();
if (change.trim().equals("")) {
//DO SOMETHING HERE
}
else
{
int i = Integer.parseInt(change);
YOUR CODE HERE....
}