Computer Science, asked by Asiyah2946, 1 year ago

How to pass two parse function in doinbackground function?

Answers

Answered by abhi1656
0
on the view.
Here is my code:

public class QueryServer extends AsyncTask <String, Void, Integer> {

protected Integer doInBackground(String... serverAddress) {
Log.d("QueryServer", ""+serverAddress[0]);
MCQuery mcQuery = new MCQuery("" + serverAddress[0] ,25565);
QueryResponse response = mcQuery.basicStat();

int Onlineplayers = response.getOnlinePlayers(); //first vaule
int Maxplayers = response.getMaxPlayers(); //second vaule

Log.d("MCQuery", "" + Onlineplayers + " OnlinePlayers");
return Onlineplayers;

}

protected void onPostExecute(Integer Onlineplayers){

TextView onlinePlayersView = (TextView) findViewById(R.id.online_players);

onlinePlayersView.setText(""+Onlineplayers+"/"+ Maxplayers); //i need to pass Maxplayers to use it here


}

abhi1656: What u understanding me
abhi1656: I m a boy
Similar questions