Re: [android-developers] how to use normal class object as context?

2011-03-08 Thread Doug
You can't do that because getApplicationContext is not a static method of Context. You need an instance of a Context to call that method, and all it does is return the Context instance that is the Application object for the app (as opposed to, say, an Activity or Service instance). Doug On

[android-developers] how to use normal class object as context?

2011-03-07 Thread Hitendrasinh Gohil
hi, i have one database class.in which i have public Database(Context ctx) { context = ctx; DBHelper = new DatabaseHelper(context); } where DatabaseHelper is a static class. Now my problem is that if i call it from activity class than there is no

Re: [android-developers] how to use normal class object as context?

2011-03-07 Thread Marcin Orlowski
how to instantiate database class from this class. if i do like db = new Database(this); it gives me error. so how can i achieve this? normal class got no idea what Context is. There's same thread on friday or sat if I remember correctly. The sugested solution was to extend Application class