Android activity chain causing cyclic behaviour
<p>In my android app, I have two activities</p>

<p>mainactivity and erroractivity</p>

<p>main activity starts (on resume) it checks wifi-not connected it opens the error activity, which simply tells user wifi is off start it and then open the app</p>

<p>User now starts wifi - reopens my app, the last activity which was error activity now shows up again.
So in the onResume of error activity I check wifi state if connected I open the main activity using startActivity .</p>

<p>User is now on mainactivity but here comes the bug, </p>

<p>User now can no-longer press back button to end the main activity, because when he presses back, it seems to go to erroractivity which again opens the mainactivity, </p>

<p>Any ideas how to sort it out ?</p>

<p>Thanks, </p>
