Possible Duplicate:
Static Way to get Context on android?
Not sure if the answer is correct, but this thing is stopping me from progress for days already.
I got two classes:
- public class CfmDbAdapter which consist:
- private static class DatabaseHelper extends SQLiteOpenHelper
- series of methods to service the database
- public class DataToArray extends Application
I extended Application just to have access to Context but I have to access methods from CfmDbadapter. In all my Activity classes I do it by:
private CfmDbAdapter db;
db = new CfmDbAdapter(this);
db.open(); //one of the methods I need to access
I can't do that in my DataToArray class since it's parent is not a Context class (I gues). I can't acess methods staticly aswell, it would fck up whole code.