Skip to content

Instantly share code, notes, and snippets.

@ankit-cerulean-1
Created April 23, 2017 09:43
Show Gist options
  • Save ankit-cerulean-1/b66b1a4e1bdea5ec74cbe68d10f2949c to your computer and use it in GitHub Desktop.
Save ankit-cerulean-1/b66b1a4e1bdea5ec74cbe68d10f2949c to your computer and use it in GitHub Desktop.
sdfsdf
private void getData() {
MainActivity.getRestClient().getRestInterface().getData().enqueue(new Callback<List<ModelClass>>() {
@Override
public void onResponse(Call<List<ModelClass>> call, Response<List<ModelClass>> response) {
//Toast.makeText(getApplicationContext(), "Call response", Toast.LENGTH_SHORT).show();
if (response.isSuccessful()) {
List<ModelClass> allserverdata = response.body();
}
}
@Override
public void onFailure(Call<List<ModelClass>> call, Throwable t) {
Log.d("Error in response :", t.getMessage());
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment