This must be really easy but I am stuck now for an hour or so. I am passing String[]
to an AsyncTask
class as such
class test extends AsyncTask<String, Void, Void>{
@Override
protected Void doInBackground(String... params) {
// Again, use either params local to this function
// or args local to the entire function...
// both would be redundant
String _NAMESPACE = params[0];
String _METHODNAME = params[1];
String _SOAPACTION = params[2];
String _USER_NAME = params[3];
String _USER_PASS= params[4];
// Do background stuff
}
}
I am sending my arguments as such
test t = new test();
String[] s = {"a", "b", "c", "d", "e"};
t.execute(s);
This is not working. How would I pass multiple String
objects is my question. If I pass one string it works but if I try to pass them in an array it fails. btw I don't want to change the string parameter of the AsyncTask
class to String[]
because it would break my other code. Any help would be appreciated.