简体   繁体   中英

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!

将此行添加到您的Gradle依赖项中:

  compile 'com.android.support:preference-v7:24.2.1'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM