I need to go from an activity to another only if the condition was true If the condition was false I need it to stay in the same activity
the true condition is working and it is moving me to the second activity While the (false) is closing the whole program and don't stay in the activity, how can I prevent that? My code is as follows (below -else- I added some ways but they didn't work at all):
Intent move = new Intent(this, MainActivity.class);
if(minString != null && maxString !=null) {
startActivity(move);
}
else {
// minString.setError( "fill the field!" );
//Toast.makeText(getApplicationContext(), "fill the field", Toast.LENGTH_SHORT).show();
//Intent move = new Intent(this, FirstActivity.class);
// startActivity(move);
}
Aucun commentaire:
Enregistrer un commentaire