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

iphone - Using nested NSDictionary with Picker -

javascript - Iterate over array and calculate average values of array-parts -

php - Time zone issue -