alertDialog = new ProgressDialog(this);
alertDialog.setMessage(getResources().getString(R.string.loader));
alertDialog.setCancelable(false);
For API 21+ you can define the following style to colour the material progress dialog. Note that this should be under values-v21
if you support lower platforms.
is for AppCompat whereas
is for API 21+. Material progress dialogs don't work with AppCompat, even with the new v22.1
Support lib AppCompatDialog.
You can see Chris Banes' answer here stating that he will not backport Progress Dialogs because they are "a bad pattern".