Recently in a simple dialog frame, the effect is simply to make a display effect on Android 2.x to Android 4.x similar to the dialog box.
The idea is simple, is to use decorative mode wrapped dialog, exposed interface calls will automatically complete some settings
But encountered a particularly strange problem, on Android 2.x Dialog dialog box can not be dismiss, as long as the interface will be snapped, the forced use of Eclipse re-run will cause the Android device black screen is unresponsive, if it is the emulator, it crashes directly, 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 later. 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.
If the translate animation is swapped, it behaves normally.
I asked on the StackOverflow, and no one answered, and they commented on why it was compatible with Android version 4.0. Well, I'll definitely refuse to be compatible.
This should be a bug. If anyone understands the welcome comment, criticize it.
Dialog specific conditions on Android 2.x cause a bug that cannot be dismiss