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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -