Bom Dia,--Estou alterando o meu projeto de AsyncTask para Retrofit2 e estou encontrando dificuldades no que diz respeito ao carregamento dos dados. Quando ele faz a chamada, o progressDialog para de repente. Ele funciona normalmente, o problema é que ele fica parada. Alguém saberia me dizer o q eu estou fazendo de errado?@OnClick(R.id.bt_login)
public void login() {String matricula = etMatricula.getText().toString();
String senha = etSenha.getText().toString();pd = new ProgressDialog(this);
pd.setMessage(getResources().getString(R.string.enviando_dados_novo));
pd.setCancelable(false);
pd.show();
mAPIService.login(matricula,
senha,
Controller.getInstance().getImei(LoginActivityBackup.this),
Controller.getInstance().getVersao(),
Controller.getInstance().getRelease()).enqueue(new Callback<Object>() {
@Override
public void onResponse(Call call, Response response) {
if (response.isSuccessful()) {
try {
JsonElement gson = new Gson().toJsonTree(response.body());
String result = gson.getAsJsonObject().get("result").toString();
if (result.contains("OK")) {
carregar_webservice_login((JsonObject) gson);
handler.sendEmptyMessage(Constants.LOGIN_OK);
}
}catch (Exception e){
Util.showAlertDialog(LoginActivityBackup.this, R.string.erro+ "\n\n"+ e.getMessage());
}
}else{
Util.showAlertDialog(LoginActivityBackup.this, R.string.erro+ "\n\n"+ response.message());
}
}
@Override
public void onFailure(Call call, Throwable t) {
Log.e(Constants.TAG, "Unable to submit post to API." + t.getMessage());
}
});
}
}
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.