dsharew
dsharew

Reputation: 10665

Where to find AppCompatPreferenceActivity?

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.

Upvotes: 4

Views: 2026

Answers (3)

lenooh
lenooh

Reputation: 10682

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).

Upvotes: 0

Rikin Prajapati
Rikin Prajapati

Reputation: 1943

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.

Upvotes: 3

Valdio
Valdio

Reputation: 109

Updating the gradle imports to the latest versions.

Upvotes: 0

Related Questions