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
Post a Comment