Ich habe einen progressDialog in meinem Fragment. Was ich brauche, ist einen kleinen Kreis zu zeigen. Aber es zeigt nur Nachricht. Es bringt mich umProgressDialog zeigt keinen Kreis
final ProgressDialog progressDialog = new ProgressDialog(getActivity());
progressDialog.setIndeterminate(true);
progressDialog.setMessage("My message");
progressDialog.setProgressStyle(android.R.style.Widget_ProgressBar_Large);
progressDialog.show();
Fragment - Methode zeigen Fortschritt Dialog mit Ihrer Hilfe bearbeitet
private void loginEmail() {
showProgressDialog();
FactoryAPI.getInstanceLogin().login("[email protected]", "heslo123").enqueue(new Callback<UserResponse>() {
@Override
public void onResponse(Call<UserResponse> call, Response<UserResponse> response) {
if (response.isSuccessful()) {
user = response.body().getUser();
startActivity();
progressDialog.dismiss();
} else {
Toast.makeText(getContext(), R.string.email_password_is_not_right, Toast.LENGTH_LONG).show();
}
}
@Override
public void onFailure(Call<UserResponse> call, Throwable t) {
Log.e("error", "error");
}
});
}
http://stackoverflow.com/questions/5259506/i-want-a-progress-circle-instead-of-progress-dialog –
Aufgrund dieser _progressDialog.setMessage (“ Meine Nachricht "); _ Nachricht wird angezeigt. U kann _ProgressBar_ verwenden, wenn Sie im Kreis möchten – Piyush
Replace 'progressDialog.setProgressStyle (android.R.style.Widget_ProgressBar_Large);' mit 'progressDialog.setProgressStyle (ProgressDialog.STYLE_SPINNER);' –