Recently in a simple dialog frame, the role of making a display effect on Android 2.x to Android 4.x are similar to the dialog box.
The idea is relatively simple, is the use of Decorative mode wrapping dialog, exposed interface calls will be self-active completion of some settings
But encountered a particularly strange problem, on Android 2.x Dialog dialog box can not be dismiss, just to pop out the interface to die, forced to use eclipse another run will cause the Android device black screen unresponsive, assuming that the simulator, the direct crash, See the splash screen. And this is not a ANR error.
The source of the problem was later identified by the deletion of the code, which is also the least likely to be suspected. In Style.xml I defined a dialog box with a style that inherits @android:style/theme.dialog
<style name= "Shalog" parent= "@android: Style/theme.dialog" > <item name= "Android:windowanimationstyle" > @style/shaloganimation</item></style>
The problem is that on this android:windowanimationstyle attribute, I give this attribute definition of shaloganimation to dialog enter and exit respectively set Alpha animation, Alpha Animation in API 11 and above support, That is, Android 3.0 and above. Even so, I can't understand the problem.
I remember that Android does not support the XML content is directly ignored, so theoretically this animation is ignored, but in fact, it can make the entire Android system crashes, very strange.
Assuming that the translate animation is swapped, it behaves normally.
I asked on the StackOverflow, and no one answered, and they commented on why the Android 4.0 is compatible with the version number below. Well, I will definitely refuse compatibility later.
This should be a bug. Suppose anyone who understands the welcome comment criticizes.
Dialog specific conditions on Android 2.x cause a bug that cannot be dismiss