Issue
I got through some guides, and I know, how to pass many parameters into onProgressUpdate like this
@Override
protected void doInBackground(Void... params){
publishProgress("a","b");
}
@Override
protected void onProgressUpdate(String... params){
String passed1 = params[0];
String passed1 = params[1];
}
And now. Is it somehow possible to send an array?
Like this
@Override
protected void doInBackground(Void... params){
String[] values = new String[2];
values[0]="c";
values[1]="d";
publishProgress("a","b",values);
}
@Override
protected void onProgressUpdate(String... params){
String passed1 = params[0];
String passed1 = params[1];
String passed3 = params[3][0];
String passed3 = params[3][1];
}
Because exactly this is not working. Any solutions? Please?
Solution
The code:
publishProgress("a","b",values);
Expects a signature of
protected void onProgressUpdate(String, String, String[])
To pass an array, you need all the values together:
String[] values = new String[4];
values[0]="a";
values[1]="b";
values[2]="c";
values[3]="d";
publishProgress(values);
Answered By - Knossos
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.