I have a class named MyXMLHandlerTemp which extends DefaultHandler. The class is used for parsing data.
I want to use SharedPreferences inside MyXMLHandlerTemp class but it gives me error saying
getSharedPreferences(String,int) is undefined for the type MyXMLHandlerTemp
Is it possible to use SharedPreferences inside MyXMLHandlerTemp? If not then what can be alternative solution?
You have to pass context from calling activity to the MyXmlHandlerTemp constructor . So using that context you can use sharedPreference in MyXmlHandlerTemp class.