I haven\'t spent much time working with AsyncTasks in Android. I\'m trying to understand how to pass variables to and from the class. The syntax:
Passing a simple String:
public static void someMethod{
String [] variableString= {"hello"};
new MyTask().execute(variableString);
}
static class MyTask extends AsyncTask {
// This is run in a background thread
@Override
protected String doInBackground(String... params) {
// get the string from params, which is an array
final String variableString = params[0];
Log.e("BACKGROUND", "authtoken: " + variableString);
return null;
}
}