dialogfragment

DialogFragment advantages over AlertDialog [duplicate]

萝らか妹 提交于 2019-11-27 17:35:09
This question already has an answer here: Android DialogFragment vs Dialog 7 answers When developing an Android app, I've read that it's recommended to use DialogFragment instead of using directly an AlertDialog to show alerts and confirmations. This is done, for example, on DialogFragment's Documentation: http://developer.android.com/reference/android/app/DialogFragment.html People also say they prefer this here: Android DialogFragment vs Dialog I would like to know the advantages of this approach, since the code becomes more complex. Thanks Tobrun Use DialogFragment over Dialog: Since the

Change DialogFragment enter/exit transition at just before dismissing

谁说胖子不能爱 提交于 2019-11-27 10:46:05
问题 I have a DialogFragment and i set animation for enter/exit in the onActivityCreated method as below @Override public void onActivityCreated(Bundle arg0) { super.onActivityCreated(arg0); getDialog().getWindow() .getAttributes().windowAnimations = R.style.DialogAnimation; } my DialogAnimation style files is as follows <style name="DialogAnimation"> <item name="android:windowEnterAnimation">@android:anim/fade_in</item> <item name="android:windowExitAnimation">@android:anim/fade_out</item> <

Detect back button but don't dismiss dialogfragment

别说谁变了你拦得住时间么 提交于 2019-11-27 07:10:29
I have a dialogfragment for a floating dialog which includes a special keyboard that pops up when a user presses inside an EditText field (the normal IME is stopped from being displayed). I would like the keyboard to be dismissed (visibility = GONE) when the user presses the back button (just as with a normal IME service) but the dialog to remain visible. However, there does not appear to be a way to do this as far as I can see from my fairly extensive reading on SO and elsewhere. If I set the dialog to be non-cancelable then I don't get notified by onCancel() or onDismiss() because the dialog

DialogFragment advantages over AlertDialog [duplicate]

我是研究僧i 提交于 2019-11-27 04:13:00
问题 This question already has an answer here: Android DialogFragment vs Dialog 7 answers When developing an Android app, I've read that it's recommended to use DialogFragment instead of using directly an AlertDialog to show alerts and confirmations. This is done, for example, on DialogFragment's Documentation: http://developer.android.com/reference/android/app/DialogFragment.html People also say they prefer this here: Android DialogFragment vs Dialog I would like to know the advantages of this