Powyższe odpowiedzi nie działał na mnie.
użyłem następujące podejście
// Initializing the alertDialog
AlertDialog alertDialog = new AlertDialog.Builder(QuizActivity.this).create();
alertDialog.setTitle("Warning");
alertDialog.setMessage("Are you sure you want to exit?");
alertDialog.show(); // This should be called before looking up for elements
// Getting the view elements
TextView textView = (TextView) alertDialog.getWindow().findViewById(android.R.id.message);
TextView alertTitle = (TextView) alertDialog.getWindow().findViewById(R.id.alertTitle);
Button button1 = (Button) alertDialog.getWindow().findViewById(android.R.id.button1);
Button button2 = (Button) alertDialog.getWindow().findViewById(android.R.id.button2);
// Setting font
textView.setTypeface(FontHelper.getFont(Fonts.MULI_REGULAR));
alertTitle.setTypeface(FontHelper.getFont(Fonts.MULI_REGULAR));
button1.setTypeface(FontHelper.getFont(Fonts.MULI_BOLD));
button2.setTypeface(FontHelper.getFont(Fonts.MULI_BOLD));
Testowane na 7.1.1
UWAGA: Upewnij się, że masz element po okazaniu dialog
. Bez tego dostaniesz NullPointerException
dziękuję mikeswright49. Działa świetnie. Uratowałeś mój czas. – IndieBoy
To dobrze, pamiętaj, aby zatwierdzić i przegłosować, gdy uzyskasz przywileje, aby inni ludzie mogli uzyskać tę pomoc. – mikeswright49
Próbowałem zrobić, ale kod ur jest naprawdę niesamowity :) dziękuję za dużo – Gattsu