I am using AsyncTask and want to use getApplication() to work with class Application.
But gets error on getApplication() cannot find symbol.
my code:
public class splash extends AsyncTask {
protected config app;
public splash(Context context) {
super();
app = ((config) getApplication());
this.context=context;
}
and the class that I want to use:
public class config extends Application
{
public Boolean con=true;
public int status=-1;
public String actNum;
public void onCreate()
{
super.onCreate();
}
}
If you want to get the
Applicationinstance, you can initialize a member inonCreate()with it and have it returned by a class method:Then you can retrieve this instance everywhere via: