Deprecated Preference Activity method

Posted by Adnan Nazir on Stack Overflow See other posts from Stack Overflow or by Adnan Nazir
Published on 2012-08-08T08:26:20Z Indexed on 2012/09/04 3:38 UTC
Read the original article Hit count: 154

Filed under:

package com.adi.preferencedemotest;

i am working on PreferenceActivity but when i call my preference xml(prefs.xml) with the help of addPreferencesFromResource it says this method is deprecated and "This function is not relevant for a modern fragment-based PreferenceActivity" is there any alternative of this method? how i can handle ?

public class PrefsActivity extends PreferenceActivity {
    @SuppressWarnings("deprecation") <-------
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        addPreferencesFromResource(R.xml.prefs); <-------
    }

}

Note: may be my question rate as duplicated but i didn't find any.

© Stack Overflow or respective owner

Related posts about android-preferences