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
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
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
3 matches
Mail list logo