if the IF statement is true view new activity
if(res.equals("5510"))
checkback.setText("Correct version");
//
else
开发者_如何学JAVAcheckback.setText("Incorrect version, please update. \n Your current version is " + getString(R.string.versioncode));
How do i get it so that if the IF statement is true then it'll start and view mainactivity.class?
I put intent in but when i did it showed up with a bunch of errors
Try this, but replace "CurrentActivity.this" with the name of the activity your calling it from.
if(res.equals("5510")){
checkback.setText("Correct version");
Intent i = new Intent(CurrentActiviy.this, mainactivity.class);
startActivity(i);
}else{
checkback.setText("Incorrect version, please update. \n Your current version is " + getString(R.string.versioncode));
}
If you still get errors then post the errors you get - it makes it a million times easier to work out where the issue is!
精彩评论