From d1bd1c8b900101c35d87ac8d28ec8c0ab673c8f7 Mon Sep 17 00:00:00 2001 From: maxieds Date: Fri, 28 Jun 2019 23:38:24 -0400 Subject: [PATCH] Small bug in selected theme in the theme change dialog (III) --- .../chameleonminilivedebugger/LiveLoggerActivity.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/maxieds/chameleonminilivedebugger/LiveLoggerActivity.java b/app/src/main/java/com/maxieds/chameleonminilivedebugger/LiveLoggerActivity.java index e873049..0bd7231 100644 --- a/app/src/main/java/com/maxieds/chameleonminilivedebugger/LiveLoggerActivity.java +++ b/app/src/main/java/com/maxieds/chameleonminilivedebugger/LiveLoggerActivity.java @@ -537,10 +537,12 @@ public void actionButtonAppSettings(View view) { } // set the correct current theme as the selected radio button: RadioGroup themeRadioGroup = (RadioGroup) dialogView.findViewById(R.id.themeRadioGroup); - ArrayList curThemeRadioBtns = new ArrayList(); - themeRadioGroup.findViewsWithText(curThemeRadioBtns, "Theme: " + storedAppTheme, android.view.View.FIND_VIEWS_WITH_TEXT); - if(curThemeRadioBtns.size() > 0) { - ((RadioButton) curThemeRadioBtns.get(0)).setSelected(true); + for(int rb = 0; rb < themeRadioGroup.getChildCount(); rb++) { + RadioButton curThemeBtn = (RadioButton) themeRadioGroup.getChildAt(rb); + if(curThemeBtn.isEnabled() && curThemeBtn.getText().toString().equals("Theme: " + storedAppTheme)) { + curThemeBtn.setSelected(true); + break; + } } // finish constructing the theme selection dialog: ScrollView themesScroller = new ScrollView(this);