Hi in the below code i have preset button using get method am sending request to gateway Api's for that am getting response from the server.
After getting the response how to set those values.
mPreset.java:
mPreset.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
getCCTAndIntensityValuesForPreset(API.GATEWAY_SCHEDULE);
}
});
Method for mPreset:
public void getCCTAndIntensityValuesForPreset(String schedulerType) {
RequestAsyntask mRequestAsyntask = new RequestAsyntask(mContext);
try {
Request request = new Request.Builder().url(API.BASE_URL +schedulerType )
.get()
.build();
mRequestAsyntask.runDataRetriver(request, false);
mRequestAsyntask.setResponseListener(new ResponseCallback() {
@Override
public void success(String response) {
Log.i(TAG, "Response:" + response);
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
Comments
Post a Comment