Should DialogFragment be called via the AsyncTask class?

I read many guides but I'm still confused. Somewhere I read that the "activity flow" should not be interrupted by a DialogFragment, so you should call DialogFragment inside a AsyncTask Class inside the Activity Class. In other guides I saw Dialo

Why is DialogFragment not destroyed while Dialog is?

as the title says, why does Android keeps the DialogFragment open when a configChange happens while any type of Dialog is being destroyed as soon as there is a configChange? is it because the Android doesn't want to keep a reference to the Context pa

Do not show the checkbox on a DialogFragment

So the title explains it all. I have a dialogfragment that currently pops up and I want to add a do not show checkbox to it and then obviously implement that check and not show if it was checked. I know there is a .setSingleChoiceItems, but I am not

Fully customized dialog box in Android

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="" android:orientation="vertical" android:layout_width="fill_parent" android:layout_hei

Display the dialog box on the back embedded in the fragment

I've an activity and inside it a fragment. What's the right procedure to ask for saving data (via a dialog) before exiting the activity? User press back Activity notify the fragment via interface onBackPressed Fragment show dialog where user can choo

DialogFragment does not recognize the finish () method

Hello ultimately what I am looking to do is to have a DialogFragment show on screen to confirm that the user wants to exit the app. If the user says that they do wish to close the app the app shuts down. If the user does not the DialogFragment goes a

Disable the positive / negative button in DialogFragment

I mimicked what I thought was fairly standard Dialog code: public class DChooseSeparator extends DialogFragment { // ... @Override public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActi

Android Imagebutton in custom list is null

i am developing an android app, which displays a listview. When i click some of the items of the listview it should open a dialog, which includes another (custom) listview. the listview in the dialog has two textviews and one (image)button (i tried b

Access a database from a DialogFragment and toast a message

I have a DialogFragment which displays a simple yes/no question. When the user presses "yes", I perform a database request (which basicaly deletes an entry). I then toast a message to report a success or failure to the user. I try to avoid calli

Hide buttons in DialogFragment in Android

I have Dialog Fragment implemented like this public class SessionExpiredFragment extends DialogFragment { public interface SessionExpiredFragmentListener { public void onCancelLoginProcessPressed(DialogFragment dialog); // validValues = true if field

Android: IllegalStateException Calls DialogFragment

i've already had this working when i had only one layout for fragment one (landscape) but now with the additonal portrait version my app crashes with an IllegalStateException in the line switch (v.getId()) heres the code: public void onTextViewClick(

Displaying a DialogFragment element in a fragment

I'm currently working on converting an Activity into a Fragment. The activity contains a Edittext that when clicked shows a DialogFragmment for picking a date. In the Activity I would simply call this to show the dialog: @SuppressLint("NewApi")

Full Screen DialogFragment (on ActionBar) in Android

Im having some problems in show DialogFragment in Full Screen. In my application, i have an Fragment that when you click in some button it calls a DialogFragment. But the DialogFragment just fills the area of the Fragment (below the action bar). I wo

AlertDialog with Custom View: Resize to wrap the view contents

I have been having this problem in an application I am building. Please ignore all of the design shortcomings and lack of best practice approaches, this is purely to show an example of what I cannot solve. I have DialogFragment which returns a basic

DialogFragment callback on the change of orientation

I'm migrating my dialogs, currently using Activity.showDialog(DIALOG_ID);, to use the DialogFragment system as discussed in the android reference. There's a question that arose during my development when using callbacks to deliver some event back to

Adjusting DialogFragment to Image Size

I have a DialogFragment with a ViewPager that shows some pictures. The problem that there's a weird black stripe on top, and these pictures are deformed. This is what I currently have, and as you can see, the picture doesn't really look good and ther

to change the height of the custom dialog in Dialogue Fragment

I have created a custom dialog, the code is below. The problem is that, the height of the dialog is becoming wrap_content, i.e it is independent of what ever the height i mention in the xml. I have checked other questions, they din't help me. public