I think Android 2.3.3 (emulator) and 2.3.4 (houhy phone), window dialogue animation style May be dismissed. My code in activity is here:
private dialogue mDialog; See private mDialogView; @ Override Protected Zero (Bundle Saved Instantstate) {Super. NET (Saved Instantstate); SetContentView (R.layout.activity_main); } Handler mHandler = New Handler () {@ Override Public Wide Handmessages (Message Message) {mDialog.dismiss (); Super.handleMessage (MSG); }}; Public Zero Click Button 2 (see View) {mDialog = New Dialogue (This, R. Style. MDialogView = LayoutInflator.fr (this). Inflett (R. Late.Tost_view, blank); MDialog.setContentView (mDialogView); MDialog.setTitle ("title"); MDialog.show (); Message message = mHandler.obtainMessage (); MHandler.sendMessageDelayed (msg, 1000); }
and the code in style.xml
& lt; Style name = "toalog" parent = "@ android: style / theme.Dialog" & gt; & Lt; Item name = "android: windowAnimationStyle" & gt; @ Style / Shelog animation & lt; / Item & gt; & Lt; / Style & gt; & Lt; Style name = "shell animation" & gt; & Lt; Item name = "android: windowEnterAnimation" & gt; @ Anime / fade_in & lt; / Item & gt; & Lt; Item name = "android: windowExitAnimation" & gt; @ Anime / fade_out & lt; / Item & gt; & Lt; / Style & gt;
code in /anim/fade_in.xml:
& lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Alpha xmlns: Android = "http://schemas.android.com/apk/res/android" Android: Interpolator = "@Android: Interpolator / Decallet_core" Android: fromAlpha = "0.0" Android: toAlpha = "1.0" Android: Period = "@ Integer / Entry Factor" />
/anim/fade_out.xml is similar to fade_in.xml
After running this code, you can see The dialogue is always displayed on the screen, and the app won does not answer your clicks if you try to reinstall it from Eclipse. While, the emulator crash.
Everything works fine on Android 4.4.4 (Xiamen phones) and 4.2.2 (XoLo phones)
Is this a bug? Or is this my fault?
The only solution I think is not to use the window. Animation style 2.x or less I do not know what will happen on Android 3.x
Comments
Post a Comment