android-dialogfragment

Where to place sign in credentials check - android Dialog

主宰稳场 提交于 2020-07-10 09:27:03
问题 I am trying to create a login credential screen when user clicks on a setting button. And if login credentials looks right then it should to settings screen. This is the official tutorial i am following. I am managed to create a dialog and it showing the window once the button is clicked. I also passing back the dialog to the Dialog host and here is the code snippet. // Dialog Fragment public class SignInDialogFragment extends AppCompatDialogFragment { // Use this instance of the interface to

TimePickerFragment Not Working

雨燕双飞 提交于 2020-05-15 08:09:46
问题 According to the official Android Dev guide, when the user clicks this button, the system calls the following method: public void showTimePickerDialog(View v) { DialogFragment newFragment = new TimePickerFragment(); newFragment.show(getSupportFragmentManager(), "timePicker"); } However, when I try this in my Fragment Activity, it shows TimePickerFragment in red. And prompts that TimePickerFragment() cannot be resolved. These are my imports related to TimePicker : import android.app

TimePickerFragment Not Working

我们两清 提交于 2020-05-15 08:09:29
问题 According to the official Android Dev guide, when the user clicks this button, the system calls the following method: public void showTimePickerDialog(View v) { DialogFragment newFragment = new TimePickerFragment(); newFragment.show(getSupportFragmentManager(), "timePicker"); } However, when I try this in my Fragment Activity, it shows TimePickerFragment in red. And prompts that TimePickerFragment() cannot be resolved. These are my imports related to TimePicker : import android.app

DialogFragment buttons pushed off screen API 24 and above

痞子三分冷 提交于 2020-04-11 18:34:11
问题 I am making a custom DialogFragment that displays a selectable list of data. The list is too long to fit on the screen without scrolling. For up to API 23, everything seems to work fine, but when I test on API 24+, the DialogFragment's button's are no longer visible. I looked at Missing buttons on AlertDialog | Android 7.0 (Nexus 5x), but that doesn't seem to apply because my buttons do show up when I reduce the amount of content in the list so that it all fits on the screen. How can I make

Android: how to dismiss a DatePicker DialogFragment when touching outside?

对着背影说爱祢 提交于 2020-02-14 09:11:24
问题 I have a working DatePickerFragment that extends DialogFragment. I set up a DatePickerDialog in onCreateDialog() and then tried to add: "picker.setCanceledOnTouchOutside(true);" I am testing on a device with Android 8.0 Oreo and nothing happens when touching outside the DatePicker dialog. I am using androidx.appcompat.app.AppCompatActivity as my BaseActivity and androidx.fragment.app.DialogFragment for the DialogFragment; Code: @Override public Dialog onCreateDialog(Bundle savedInstanceState)

How to properly retain a DialogFragment through rotation?

北慕城南 提交于 2020-01-27 08:55:42
问题 I have a FragmentActivity that hosts a DialogFragment. The DialogFragment perform network requests and handles Facebook authentication, so I need to retain it during rotation. I've read all the other questions relating to this issue, but none of them have actually solved the problem. I'm using putFragment and getFragment to save the Fragment instance and get it again during activity re-creation. However, I'm always getting a null pointer exception on the call to getFragment in

Show DialogFragment when user clicks deny on Runtime permissions dialog

末鹿安然 提交于 2020-01-25 20:59:07
问题 I'm trying to show a DialogFragment right after the user clicks "Deny" on the "allow/deny permission" dialog of android 6 But instead I'm getting this error: Caused by: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1448) at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1466) at android.support.v4.app.BackStackRecord.commitInternal

Android - DialogFragment change title text color

我是研究僧i 提交于 2020-01-15 18:59:09
问题 In my application I am changing the DialogFragment title bar background color on runtime. The problem is on different android versions the title text color is changing automatically so it looks sometimes ugly. I want to set a standard title text color for all smartphones. I followed this sample here to build my DialogFragment. How to set the title text color? 来源: https://stackoverflow.com/questions/26829554/android-dialogfragment-change-title-text-color

Place a button inside DialogFragment's title

佐手、 提交于 2020-01-15 09:45:52
问题 I show a DialogFragment from another DialogFragment . I need to set title and a button just next to it. I don't want to reimplement the theme and create a custom view inside DialogFragment 's content view instead of dialog title (because it's error-prone and time wasting). Is it even possible? I tried many API functions, AlertBuilder , ActionBar , this and that, still didn't found anything that fits my needs. 回答1: Try something like this: // Title final int titleId = getResources()

Replace Button Background of Android DialogFragment

萝らか妹 提交于 2020-01-14 09:41:27
问题 So I previously solved this problem thanks to the help of another thread, but due to some new changes to my app the previous solution no longer works. Here's the previous thread: Android App: Replace default button background with custom background in a Dialog Fragment I'm trying to style the background drawables of the positive/negative buttons of a custom DialogFragment, and cannot seem to get any change to stick. Originally, I used the following: @Override public void onStart() { super