Questions tagged [dialog-preference]

A class in the Android preferences framework that allows applications to implement custom user interfaces for editing a preference setting.

A class in the Android preferences framework that allows applications to implement custom user interfaces for editing a preference setting.

A very useful guide for writing DialogPreference implementations can be found in this answer: Concise way of writing new DialogPreference classes?

67 questions
1
vote
1 answer

DialogPreference force close

For a school project, I'm building an application using PreferenceScreens as a framework. I've created 2 new classes to suit my needs: SeekBarDialogPreference (designed to handle volumes and brightness) and DigitalPreference (for everything…
gobernador
  • 5,659
  • 3
  • 32
  • 51
1
vote
0 answers

Custom DialogPreference with custom layout: IllegalStateException: The specified child already has a parent

I have a custom DialogPreference with a custom dialog layout. The UI crashes on the second time I click on it, with java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. I…
Sah
  • 1,017
  • 2
  • 11
  • 19
1
vote
1 answer

Appcompatactivity with custom native (not compatibility) dialogpreference containing a TimePicker

I am building a preferences / settings screen inside an Android AppCompatActivity. One requirement is a custom [DialogPreference][1] with a TimePicker. The DialogPreference must be 'native', meaning not the compatibility version like described here…
1
vote
0 answers

onCreateView only called once for Fragment in DialogPreference

I have a Fragment that overrides the public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) method without a call to super like this: @Override public View onCreateView(LayoutInflater inflater,…
feob
  • 1,930
  • 5
  • 19
  • 31
1
vote
0 answers

Use alertDialog builder for preferenceDialog

I am trying to make a custom preference using aa multi select list that I want to programmatically fill in. I tried to create a custom DialogPreference as seen below and used a AlertDialog builder to create my dialog. The problem is that piecing…
1
vote
1 answer

Extend EditTextPreference and display the DialogMessage

I have extended EditTextPreference, but the Dialog Message won't display. This happens if I add the dialogMessage programatically or in the the preferences.xml. Here is my onBindDialogView: AutoCompleteTextView editText =…
1
vote
0 answers

Set custom font to Dialog Preferences

I created custom dialog to get input from users extending DialogPreferences class for setting. i need to change font used in dialog and external font using typeface. i set the font to massage using following code. but i couldn't set it for title…
Kelum Deshapriya
  • 258
  • 4
  • 14
1
vote
1 answer

Getting a Fragment from a DialogPreference?

I have a DialogPreference, that I'm trying to get a Fragment that is added to it (Google Maps, if anyone cares). The fragment has an id tag in the XML code, and I'm setting the dialog via setDialogLayoutResource(). However, I'm struggling to get a…
PearsonArtPhoto
  • 38,970
  • 17
  • 111
  • 142
1
vote
1 answer

Dialog preference with radio buttons

I have a dialog preference with a custom layout, and the custom layout has 4 radio buttons. I have a DialogPreference.java file where the layout is set fine by setDialogLayoutResource(R.xml.imagechoice); and what I would like to do is reference the…
ez4nick
  • 9,756
  • 12
  • 37
  • 69
1
vote
1 answer

ListPreference without the radio

I am making the preference screen for my app. Inside the preference screen, I have a ListPreference to “Spread the word” about the app. However, I don't want the radio buttons there. I want the whole dialog seem as if it is a list of things the user…
Rahul Jiresal
  • 1,006
  • 13
  • 24
1
vote
2 answers

Keyboard shows up in "DialogPreference" type layout with TextEdit

I have a problem with the keyboard. I've research all the "Stackoverflow", I've tested million of different methods. And still cannot to make the keyboard hidden, when the "Dialog" shows up. May be anybody has a 10000% working solution? public class…
user922907
  • 539
  • 2
  • 8
  • 18
1
vote
1 answer

Starting fragment on button click in DialogPreference

I have a PreferenceActivity from which I am trying to create a dialogpreference on click of preference. I first tried to keep my DialogPreference class (MyPreferencefragment) outside the PreferenceActivity class and the layout was …
1
vote
0 answers

How to show/hide buttons of custom dialog in preferences dynamically?

I have created a custom dialog that is used from a preference screen. Everything works fine except one thing: I want to switch the visibility of the Cancel button based on the status of an internal check. Normally you have onPrepareDialog and…
user1131536
  • 537
  • 2
  • 6
  • 16
1
vote
1 answer

Android inflating custom view in XML ClassNotFound error

I have some problems with my XML code i hope you can help me with. I have this class in this package: package com.example.myview public class CustomDialog extends DialogPreference { public CustomDialog(Context context, AttributeSet attrs) { …
1
vote
1 answer

Android Spinner in Custom DialogPreference forced close the application on Orientation change

I created a custom dialog preference, that has two spinners in order to select a specific interval of time (e.g. 2 seconds or 2 minutes ou 3 hours etc.) So, when I click my custom preference in the preference screen the custom dialog preference pops…
SnitramSD
  • 1,169
  • 3
  • 10
  • 18