I have an activity that makes something and then starts another activity. The first activity has to finish after creating the second. In this case I want it only to end with default onDestroy(). But if user presses back key (Hardware one) while first activity isn’t done I want it to call a function before finishing.
Is there any gentle way to achieve that? I think about overriding default action for back key but is it the only and the most elegant solution?
I have an activity that makes something and then starts another activity. The first
Share
Overriding
onBackPressedmethod is OK.http://developer.android.com/reference/android/app/Activity.html#onBackPressed()