I have an Asynctask which retrieves two int vaules and i want to pass them to onPostExecute to show them on the view.
Here is my code:
public class Q
public class QueryServer extends AsyncTask {...}
Replace the Integer generic param to ArrayList or to Integer[]
This way your doInBackground() will look like this:
protected Integer[] doInBackground(String... serverAddress)
{
...do what you need to do...
//Then create an array, fill with data, and return.
Integer[] arr = new Integer[10];
for(int i=0; i<10; i++)
arr[i] = i; //just an example
return arr;
}
And the in your onPostExecute()
protected void onPostExecute(Integer [] Onlineplayers)
{
//Do whatever you want with your array
}