4

I am trying android v7 support library and I have this on my gradle file:

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

I am getting class not found error for AppCompatPreferenceActivity.

I can copy the class from here but am not sure if that is the right way of doing it.

3 Answers 3

3

There is PreferenceActivity (android.preference.PreferenceActivity).

AppCompatPreferenceActivity is not a part of v7 support library, though it is a part of demos, look into this.

You can also copy the same from Here.

2
  • 1
    hmm ... so copying the class is the solution?
    – dsharew
    Feb 6, 2017 at 8:57
  • 1
    Yes, as it is not a part of library. Feb 6, 2017 at 8:58
0

Updating the gradle imports to the latest versions.

0

I had a project where Android Studio automatically added this file when adding a SettingsActivity through the wizard.

However, at a later point I repeated the same exact steps for another project and this class was NOT added automatically. So I copied the file from one project to the other, and problem solved (the file is AppCompatPreferenceActivity.java located in the main folder).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.