android-dialogfragment

DialogFragment callback to Target Fragment using interface

邮差的信 提交于 2020-08-24 08:27:12
问题 I am trying to send some data from a dialogfragment to the targeted fragment but its not working. I have written the following code, but it through exception : java.lang.NullPointerException: Attempt to invoke interface method 'void com.x.x.FragmentAlertDialog$Communicator.setI(java.lang.String)' on a null object reference Code: public class FragmentAlertDialog extends DialogFragment { Communicator callback; public interface Communicator { void setI(String name); } public static

Why is my DialogFragment not showing the custom layout?

徘徊边缘 提交于 2020-08-06 14:00:51
问题 I want to show a DialogFragment with no title, buttons, etc.(i.e, none of what is included in a typical Dialog) but just a ProgressBar spinner on a plain background. For a rough idea, the background's width matches that of the parent and spinner lies at the center of it. For this, I have a custom layout as follows: <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com

Where to place sign in credentials check - android Dialog

亡梦爱人 提交于 2020-07-10 09:27:13
问题 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