Fix choice dialogs on API 19 by manually getting drawable
This commit is contained in:
parent
b5c60d2be2
commit
b575046c05
1 changed files with 4 additions and 1 deletions
|
@ -25,6 +25,7 @@ import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.content.res.AppCompatResources;
|
||||||
import androidx.core.app.NotificationCompat;
|
import androidx.core.app.NotificationCompat;
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
|
|
||||||
|
@ -313,7 +314,9 @@ public class RouterActivity extends AppCompatActivity {
|
||||||
final RadioButton radioButton
|
final RadioButton radioButton
|
||||||
= (RadioButton) inflater.inflate(R.layout.list_radio_icon_item, null);
|
= (RadioButton) inflater.inflate(R.layout.list_radio_icon_item, null);
|
||||||
radioButton.setText(item.description);
|
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.setChecked(false);
|
||||||
radioButton.setId(id++);
|
radioButton.setId(id++);
|
||||||
radioButton.setLayoutParams(new RadioGroup.LayoutParams(
|
radioButton.setLayoutParams(new RadioGroup.LayoutParams(
|
||||||
|
|
Loading…
Add table
Reference in a new issue