Dialog specific conditions on Android 2.x cause a bug that cannot be dismiss

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.