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 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

Related Article

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.