using Retrofit i am sending an ID of Device through POST and receive a response which consist of some data i want to show that data in simple text

Viewed 18

here is response how do i get the post response into a string

//here is my activity class

    call.enqueue(new Callback<Info>() {
        @Override
        public void onResponse(@NonNull Call<Info> call, @NonNull Response<Info> response) {

            Info inforesponse = response.body();
            if ( response.isSuccessful() && inforesponse != null) {
                String massege = inforesponse.getAirQuality();
                String la = inforesponse.getLatitude();
                Log.e("loangg", "getlang  " + inforesponse.getLongitude());

                Toast.makeText(Dashboard.this, "success" +la, Toast.LENGTH_SHORT).show();

// Log.d("get", "res" + response);

            }
        }

        @Override
        public void onFailure(Call<Info> call, Throwable t) {
            Toast.makeText(getApplicationContext(), "An error has occured" + t, Toast.LENGTH_LONG).show();

        }


    });
}
0 Answers
Related