java - The method getApplicationContext() - how to use without Activity -


i have async task called within activity:

    public class downloadfile extends asynctask<string, integer, string>{ protected string doinbackground(string... url) { 

because of there's things cannot do, 1 of it's using getapplicationcontext()

there's way solve problem?

pass application context in constructor

public downloadfile(context context) {     // fun stuff context, such assign class variable } 

Comments

Popular posts from this blog

php - How can I edit my code to echo the data of child's element where my search term was found in, in XMLReader? -

java - Why is BlockingQueue.take() not releasing the thread? -

jQuery Ajax Render Fragments OR Whole Page -