getSharedPreferences is creating problem for me i have searched stackoverflow other posts but the solution given is not working for me as expected
here is my code
public class checksystem extends Activity {
static SharedPreferences settings ;
static SharedPreferences.Editor editor;
public static final String PREFS_NAME = "file";
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
settings = getSharedPreferences(PREFS_NAME, 0);
editor = settings.edit();
editor.commit();
checksystem.ss();
}
....
and error is
Cannot make a static reference to the non-static method getSharedPreferences(String, int) from the type ContextWrapper
now actually i want to access file.xml prefs to save some work from this static method but i am unable to save due to this error