Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

How to display success response for get method in android using retrofit

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