6

I have a class defined like this

public class MyDialog extends DialogPreference {

and in the preference.xml

<com.package.pak.MyDialog
    android:key="my_key" android:title="Title"
    android:dialogTitle="title"
    android:dialogIcon="@drawable/app_icon" android:negativeButtonText="@null"
    android:positiveButtonText="Ok" />

My question is how can I programatically start the MyDialog ? Is there something I can call like an intent or ?

Thanks

gobernador
  • 5,659
  • 3
  • 32
  • 51
Lukap
  • 31,523
  • 64
  • 157
  • 244
  • 4
    Take a look onto this answer: http://stackoverflow.com/questions/4805896/how-to-open-or-simulate-a-click-on-a-android-preference-which-was-created-with/4869034#4869034 – Prizoff Jun 21 '12 at 19:02
  • 1
    I had a similar problem and I solved it thanks to this post: http://stackoverflow.com/questions/4805896 – Domenico Feb 16 '13 at 16:14

1 Answers1

-1

DialogPreference has a method performClick()

Jiang Qi
  • 4,450
  • 3
  • 19
  • 19