you can send several parameters as you can send them as varargs. But you must use the same type of parameter. Therefore, to do what you are trying, you can follow any of the following actions.
Option 1
you can use the setter method to set some value of a class member and then use it in doInBackGround. for example
private class DownloadFile extends AsyncTask<String, Integer, String> { private Context context; public void setContext(Context c){ context = c; } @Override protected String doInBackground(String... sUrl) { {
Option 2
Or you can use the constructor to pass values ββlike
private class DownloadFile extends AsyncTask<String, Integer, String> { private Context context; public DownloadFile (Context c){ context = c; } @Override protected String doInBackground(String... sUrl) { {
stinepike
source share