RadioButtons not working as expected - default selection error

It's not a bug. The Screen is initializing and that has to take precedence. If we put other tasks in that Block, the initialization and the other tasks may not complete - Think of them as "fighting" for the same memory (not entirely true).

So, by setting the other tasks in a Clock Timer, we give the Screen Initialization time to complete first.

Note, it is always a good idea to set Clock Timers up in the Blocks area - you can see the setting and tweak them without going back and forth to the Designer attributes palette. However, you should un-tick the values in the palette.

image

This unfortunately doesn't give a good result.

But, as said before, when I open the Relays screen for the second time ( and followings too), the radio buttons work!

Strange....

Your Blocks are incorrect! All your Radio Button set up should be in the Clock timer block.

OK, I change this now.

Like this?

...no, doesn't work like I did :slightly_frowning_face:

Yes, that's it. did you un-tick the settings in the Designer palette?

Let me search for the "Designer palette" - I don't know what this is... give me a second to find please.

image

Shall I set the intervall to 200 here?

Snap8

The Properties Palette.

If the Radio button settings still do not work, increase the time interval in the Blocks. It is set to 200, increase it to 400.

No - only set the value in the Blocks :upside_down_face:

Chris,

I can now "see" the 400ms delay when the "Realys" screen is opening.

Still, at the first screen opening, the radio buttons are odd.

I should maybe make my own radio buttons with a set of checkboxes; I think I should be able to achieve this.

I'll give it a last try by removing the RadioButton2 just to see if the RadioButton1 works.

Anyway, thank you very much for helping me :+1:

Okay, doesn't work either.

When I open the Relay screen for the first time with only 1 radio button (..containing 3 choices..), the default one is correct BUT when I select another one, the default one stays selected too meanig I have 2 choices active at the same time.

Weird...

PS: How could I share my code to allow someone else to try it too?

To make your own "radio" buttons with checkboxes, see here

https://gallery.appinventor.mit.edu/?galleryid=8e013d34-93e3-4eb8-a5b8-73434f9b349d

I'll give it a try tomorrow.

Thanks a lot to All :slightly_smiling_face:

List Pickers make easy radio buttons, no extensions needed.

If you like buttons, here is a general purpose setup you can use ...

radio_buttons.aia (3.5 KB) sample run

Dictionaries and Generic events make this customizable per your taste.

This, IMHO, is less complicated (from my gallery link):

4 Likes

Hi Roger

It seems as though the Radio Buttons extension has a fault - can you identify which extension you have? The extension developer should take a look at the issue.

When you are testing the App, what are you using? The Emulator on your PC or the Companion on your phone?

Hello Chris,

I really trust what I see on my phone so I always "build" an apk to install on the mobile (I have currently a HUAWEI P20) :wink:

Is there a way to identify the extension I use? Any version or info about it to find somewhere?

image
...doesn't help that much I guess.

Thanks a lot TIMAI2 and ABG for your examples :+1: :+1: :+1: