Lets say i have a few activity A,B and C.
Activity A is run on application start. It is supposed to do a asyntask in the background automatically to login to a server based on imei, also starting a service. If login is failed activity A will have a refresh button for user to rerun the asyn task. After login is done, the activity is being finished by finish() and flow to B then to C.
There is 2 problem faced.
At any point of time if the user were to re-run the application via app menu, activity A will run again which result in unnecessary login and running of some background service.
At activity C when i press Back it returns to B and then back which returns to main menu, which is correct. however when i press Home button and select back the app the application reruns activity A again.