Good I have this method to get the response:
public void cargarFilas(String filtro){
OkHttpClient okHttpClient = new OkHttpClient.Builder()
.addNetworkInterceptor(new StethoInterceptor())
.build();
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("http://10.0.2.2/api/"+filtro+"/")
.addConverterFactory(GsonConverterFactory.create())
.client(okHttpClient)
.build();
apiService= retrofit.create(ApiService.class);
Call<Usuario_Fila> call = apiService.list(txtBuscar.getText().toString());
call.enqueue(new Callback<Usuario_Fila>(){
@Override
public void onResponse(Call<Usuario_Fila> call, Response<Usuario_Fila> response) {
if (response.body() != null && response.isSuccessful()) {
datos = response.body();
Usuario_Adaptador_Busqueda adaptador = new Usuario_Adaptador_Busqueda(Usuario_BusquedaActivity.this, datos.getFila());
list.setAdapter(adaptador);
}
}
@Override
public void onFailure(Call<Usuario_Fila> call, Throwable t) {
Toast.makeText(Usuario_BusquedaActivity.this, "Fallo", Toast.LENGTH_SHORT).show();
}
});
}
The problem is that the activity where the method runs gets very slow and takes a long time to even hit a button. This appears in the log:
I / Choreographer (1378): Skipped 55 frames! The application may be doing too much work on its main thread.
Thank you very much.