Lados Lados - 4 years ago 125
Android Question

Android app - PreferenceDialogFragmentCompat not available

I am currently trying to create a custom Preference with a Datepicker.

For that purpose I've found a tutorial.

Next to the xml, the first step was to create a class "TimePreference" which extends "DialogPreference".

The second class was "TimePreferenceFragmentCompat" which extends "PreferenceDialogFragmentCompat".

But in my Android Studio I can't find the "PreferenceDialogFragmentCompat" class.

Nor does

import android.support.v7.preference.PreferenceDialogFragmentCompat;
work.

Does someone know what I may am missing? Are there any new ways to do what i want to achieve? (I didn't found anything newer than this tutorial).

Thanks in advance!

Answer Source

add this line to your Gradle dependencies:

  compile 'com.android.support:preference-v7:24.2.1'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download