An Android Fragment that displays a dialog window, floating on top of its activity's window.
Questions tagged [dialogfragment]
472 questions
0
votes
1 answer
Android - set style for dialog fragment
i want to create fragment dialog with black windowBackground around it, but when i add a style i have a black frame around the fragment. does somebody knows why this frame is appears in my fragment:
this my fragment xml:
`

gil cohen
- 333
- 2
- 8
- 21
0
votes
1 answer
Android DialogFragment get name of class the dialog was created from
Within my dialog fragment, I am looking to display the name of the activity from which the dialog fragment was created.
I have tried the following:
getActivity().getCallingPackage().getClass().getSimpleName();
But this throws a null point exception…

Dportology
- 836
- 1
- 9
- 32
0
votes
2 answers
Android DialogFragment accessing external class
I am trying to do a Dialog Fragment to access a external class.
In the Dialog Fragment I have this line: "new JSONParse().execute();"
In this line, Android Studio IDE says that can not be referenced from a static context.
How could I change the…

Luiz Alves
- 2,575
- 4
- 34
- 75
0
votes
0 answers
Enforce overriding?
I have a DialogFragment that displays some options in a list for the user to click on (e.g. "Do This", "Load X", "Do That", whatever).
When you click this it invokes a callback to a function which I've defined in another class, which is a switch…

KaliMa
- 1,970
- 6
- 26
- 51
0
votes
0 answers
alert imediatelly after promp causes UI to lock up in webView (with .setWebChromeClient(new WebChromeClient() and fragment dialog)
I have a bare project, just the webview and implementation for alert and prompt... each works ok by themselves but the UI stops responding if prompt is immediately inside alert: alert(prompt("hi", "test"));
Any idea on what could be causing it? …

danchik
- 181
- 10
0
votes
2 answers
NumberPicker error in AlertDialog
I'm having trouble with number picker. When i try to add min and max values in java code for the numberpicker i get this error
Attempt to invoke virtual method 'void android.widget.NumberPicker.setMinValue(int)' on a null object reference …

Tahir Ferli
- 636
- 4
- 16
0
votes
1 answer
Another DialogFragment title color issue
I've read some question related to this topic and tried some code examples. My min API level is 11. Some approaches was to get their id based on the layout source code:
dialog layout
I tried to obtain the TextView using simple this code in my…

learner
- 1,311
- 3
- 18
- 39
0
votes
1 answer
Viewpager in DialogFragment Doesn't Work
Sorry for the broad title but i have a viewpager and tablayout inside a dialog fragment but its not functioning properly. The first major issue is that the tabs appear at the top however the fragments that are supposed to appear in the tab arent…

XvKnightvX
- 579
- 7
- 23
0
votes
1 answer
How to access DialogFragment from onEditorActionListener?
I'm building a search dialog for my app in which the user puts their search query in an EditText and presses enter, which should trigger the search. The following is from my onCreateDialog method:
final AlertDialog.Builder builder = new…

trpnd
- 455
- 2
- 10
0
votes
1 answer
Is it possible to launch a dialogfragment from a dialogfragment in android
I have a scenario where I'd like to open a dialogfragment from a button click in an already open dialog fragment. I'd like the original to either stay open and the new one open on top of it or hide the original and then reopen it when the second…

Pale Neanderthal
- 61
- 5
0
votes
1 answer
Modfiying inflated inflated view in a dialogfragment after calling show()
Let's say you have a dialogfragment with a listView. The title of the dialog is a custom view which is inflated in onCreateDialog(). Is it possible to toggle visibility of the inflated view when the list item is clicked.

akyirem samuel
- 78
- 8
0
votes
1 answer
How to setAlarmManager at Dialog fragment in android
I am creating a alerm type notification for my application.But facing a null pointer error.From a dialogfragment, AlarmManager indicating the null. Here is my code.
if(alermId>=0){
Log.e("Alerm Id: ",""+alermId);
Intent…

Abdullah Al Noman
- 79
- 2
- 12
0
votes
2 answers
Hide Keyboard when select item from spinner in DialogFragment
I am trying to hide keyboard after selecting an item from Spinner but the code is not working and nothing happens. But in other side the same code works in normal fragment.
Here is the method to hide keyboard:
public static void hideKeypad(Activity…

Mohammed Elbakly
- 55
- 6
0
votes
3 answers
Android DialogFragment with custom layout remove white border
I have a DialogFragment class with following code:
public class LeavingAppDialog extends DialogFragment {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
…

Sam Stone
- 477
- 2
- 10
- 33
0
votes
0 answers
How to dismiss DialogFragment from AsyncTask, when the home button is pressed and the device is resumed with changed rotation
I have an AsyncTask which dismisses the DialogFragment. I am facing a problem when the AsyncTask tries to dismiss the dialog after pressing the home button. dismissAllowingStateloss() helps to this case, but one issue still remains. When I press…

X-HuMan
- 1,488
- 1
- 17
- 37