0

I am trying to implement a DialogPreference by subclassing the DialogPreference class and declaring it in my preferences xml file.

When I call the AddPreferencesFromResource in my PreferenceActivity I get a System.NotSupportedException. I cannot catch this exception to copy it so I have a couple of screen shots below of what it looks like when the exception is thrown.

I have copied and coverted the code for the DialogPreference from here.

How can this be implemented in Mono for Android?

This is my xml for the DialogPreference:

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="Opening Odds">
    <app.monodroid.TimePickerPreference
     android:key="openoddstime"
     android:title="Opening Odds Time"
     android:dialogMessage="Time of day to get the opening odds."
     android:defaultValue="">
    </app.monodroid.TimePickerPreference>
</PreferenceCategory>

Screenshots: enter image description here

enter image description here

Community
  • 1
  • 1
startupsmith
  • 5,554
  • 10
  • 50
  • 71

1 Answers1

0

t may be wrong, but I'm pretty sure that you ate missing the constructor that takes two arguments, IntPtr and Android.Runtime.JniHandleOwnership. I think you have to override the base constructor of all wrappers.

Matthew
  • 4,832
  • 2
  • 29
  • 55