I have a MainActivity
"A", which have a button that launch activity "B", and activity "B" have another button that launch activity "C". In the activities B and C, both have onBackPressed()
method, which appears an AlertDialog
asking if the user wants to return to MainActivity
. If they press yes, the program should show MainActiviy.
The question is: in activity B, i have not problem, simply call the finish()
method, and MainActivity
appears, but the problem is in activity C, if i call a finish()
method, the program is back to activity B. How back to MainActivity
from activity C??