A serious bug was found in the current project (android2.0. When the and B pages are opened, the current page is B. If finish () is called in B, however, B does not execute the ondestroy () method. B is executed only when a key is pressed on the mobile phone. ondestroy (). B will be completely destroyed. In addition, if you press the return button that comes with your mobile phone, this will not happen.
Therefore, if there are some operations in the ondestroy () method at this time, B will not destroy them in time if the return to a does not perform the key operation, so no such operations will be performed in the method.
After positioning and modification, we found that this bug was caused by setting Android: theme = "@ Android: style/theme. notitlebar" On page a in androidmanifest. xml ". This parameter is not set on page B. After adding this setting to B, the problem is solved.
Although the problem has been solved, I have never understood that Android: theme = "@ Android: style/theme is not set. why can't ondestroy () be called immediately after finish () on the notitlebar page (). It is reasonable to say that there should be no association between the two.