I have Main Activity. That has 4 tabs (TabHost
). I have overridden onBackPress()
in MainActvity, as well as all four activities. This button show user a dialog box and for conformation of Exit
When app start. It show first tab. Then if I press back it works fine.
But if I go for next 3 tab and then press back, the app stop. OnDestroy()
of Main is called. But there is not dialogue for the user.Even noting is print in log cat. That I have written in onBackPressed()
method From and of 5 activities including MainActivity
.
I have also try onKeyDown()
for back key, but the result is same. Why is that the case?