Hi, I have the following code but there is an error: "The method
getSharedPreferences(String, int) is undefined for the type
EventsData".

Does it mean I need to extend both SQLLiteOpenHelper and Activity?
How to do that or how to fix this?

Many thanks.

---code---
import android.content.Context;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class EventsData extends SQLiteOpenHelper {
       // code blah, bah

        private boolean ABC() {
                String PREFS = "abc";
                final SharedPreferences settings = 
this.getSharedPreferences(PREFS,
0);
                // code blah blah
        }


}

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to