0

введите сюда описание изображения

Проблема когда включена темная тема кнопки не видно (нужно чтобы они были белые)

Override
    public void onBackPressed() {
        new AlertDialog.Builder(this)
                .setTitle("Обновить или выйти?")
                .setNeutralButton("Обновить" , new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface arg0, int arg1) {

                        recreate();
                    }
                })
                .setPositiveButton("Выйти", new DialogInterface.OnClickListener()
                {
                    public void onClick(DialogInterface arg0, int arg1)
                    {
                        finishAndRemoveTask();
                    }
                }).create().show();
    }

Проверяю темную тему так

  if (currentNightMode==UI_MODE_NIGHT_YES) {}
else
{}
1

1 ответ 1

1
Заменил   
new AlertDialog.Builder(this) 
 на     new AlertDialog.Builder(this,R.style.AlertTheme)

<style name="AlertTheme" parent="Theme.AppCompat.Dialog.Alert">
        <item name="android:background">#ffffff</item>
        <item name="android:textColor">#212121</item>
        <item name="android:textColorPrimary">#212121</item>

Результат устроил

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.