I'm working on a project that can get data from the cloud server, I'm using ubidots as my cloud server. Now I am trying to set the values I got from server to display on textView, but I cannot set it. I need to find a way where the textView have to be changed whenever the data variable changes. I don't know what do to on onPostExecute.
public class ApiUbidots extends AsyncTask<Integer, Void, Value[]> {
private final String API_KEY = "86b3ab3XXXXXXXXXXXXXX";
private final String VARIABLE_ID = "5660XXXXXXXXXXXXX";
@Override
protected Value[] doInBackground(Integer... params) {
ApiClient apiClient = new ApiClient(API_KEY);
Variable gasDetector = apiClient.getVariable(VARIABLE_ID);
Value[] variableValues = gasDetector.getValues();
return variableValues;
}
@Override
protected void onPostExecute(Value[] variableValues) {
// Update your views here
}
}