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

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -