From b575046c05c9a47ceb856a626c79aa45933aae6e Mon Sep 17 00:00:00 2001 From: Stypox Date: Wed, 1 Apr 2020 15:15:38 +0200 Subject: [PATCH] Fix choice dialogs on API 19 by manually getting drawable --- app/src/main/java/org/schabi/newpipe/RouterActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/RouterActivity.java b/app/src/main/java/org/schabi/newpipe/RouterActivity.java index 7d765e276..39f6b217d 100644 --- a/app/src/main/java/org/schabi/newpipe/RouterActivity.java +++ b/app/src/main/java/org/schabi/newpipe/RouterActivity.java @@ -25,6 +25,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.content.res.AppCompatResources; import androidx.core.app.NotificationCompat; import androidx.fragment.app.FragmentManager; @@ -313,7 +314,9 @@ public class RouterActivity extends AppCompatActivity { final RadioButton radioButton = (RadioButton) inflater.inflate(R.layout.list_radio_icon_item, null); radioButton.setText(item.description); - radioButton.setCompoundDrawablesWithIntrinsicBounds(item.icon, 0, 0, 0); + radioButton.setCompoundDrawablesWithIntrinsicBounds( + AppCompatResources.getDrawable(getApplicationContext(), item.icon), + null, null, null); radioButton.setChecked(false); radioButton.setId(id++); radioButton.setLayoutParams(new RadioGroup.LayoutParams(