iamnp
iamnp

Reputation: 508

android preferences under different versions

I am writing an Android app with preferences. I have minSdkVersion="7" and android:targetSdkVersion="17" Should I use PreferenceActivity or PreferenceFragment or maybe together to make it work on android from 2.1 to 4.2? When I use PreferenceActivity Eclipse tells me The method addPreferencesFromResource(int) from the type PreferenceActivity is deprecated

Upvotes: 0

Views: 172

Answers (2)

Zyoo
Zyoo

Reputation: 773

You should use both PreferenceActivity and PreferenceFragment because PreferenceFragment is supported on API 11 onward and isn't available on Support Library. See here.

Upvotes: 0

TN888
TN888

Reputation: 7739

You can use deprecated methods. It's only warning. If you want, you can find actual method in android documentation but this isn't good approach, because this method can not run on older devices. I hope I helped

Upvotes: 1

Related Questions