I am fetching some data from my server using the retrofit
api:
Call<String> call = api.fetch_details("get details",emp.getText().toString());
if (call != null) {
call.enqueue(new Callback<String>() {
@Override
public void onResponse(Call<String> call, Response<String> response) {
if(response.body()!=null){
//display result here
}
}
}
}
It takes some time for the data to be fetched and displayed, so in the mean time I want to play a loading gif as animation. How do I proceed?