android - How to exit as Sub in Java -
in vb create code:
sub doitnow() dim = 1 = 1 45 if = 5 exit sub end if = +1 next end sub
in java how exit early? have program settings , diferent ways enter program , if enter without having settings done, wish stop activity , send them settings activity.
currently have:
try { ls = new loadsettings(add.this); gs = new globalsubs(); } catch (exception e) { intent c = new intent(this, preferences.class); finish(); startactivity(c); }
but same activity continues , not stop creating force stop error.
to exit function in java, place return
on line want exit:
for (int = 1 ; != 45 ; a++) { if (a == 5) { return; } }
Comments
Post a Comment