A
A
Andrey Goroshko2018-08-29 20:46:16
Android
Andrey Goroshko, 2018-08-29 20:46:16

How to implement my cneckbox android selection algorithm?

In my program I have a RadioGroup of three buttons: red, green and blue. I have this listener code:

RadioGroup radGrp = findViewById(R.id.radios);
        radGrp.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() //слушатель для выбора цвета светодиода
        {
            @Override
            public void onCheckedChanged(RadioGroup arg0, int id) {
                byte k;
                String color = null;
                switch (id) {

                    case R.id.red:
                        color = "КРАСНЫЙ.";
                        k = 'R';
                        myThreadConnected.write2((byte) 'R');
                        break;
                    case R.id.green:
                        color = "ЗЕЛЕНЫЙ.";
                        k = 'G';
                        myThreadConnected.write2((byte) 'G');
                        break;
                    case R.id.blue:
                        color = "СИНИЙ.";
                        k = 'B';
                        myThreadConnected.write2((byte) 'B');
                        break;
                    default:
                        break;
                }
                selection.setText(getString(R.string.color, color));
            }
        });

and I want to implement such an algorithm - until the red button is selected, then the green and blue ones are not clickable, after the red button is selected, then make the green one clickable, after the green one is activated, then the red one becomes locked, and the blue one is unlocked, after blue is selected, then the previous two become locked. I agree that I explained very confusingly, but I hope that they will help me here.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Z
zdiii, 2015-03-11
@zdiii

Found!
In the play market, you need to search for "SMS Gateway", a bunch of applications will come out.

Y
Yuri Vasiliev, 2015-03-06
@wascoyur

SMS Backup + sends SMS to the mail, it also restores back.

D
DFMaster, 2015-03-07
@DFMaster

Forwarding can be done with scripts via Tasker. Create a profile for processing incoming SMS in it and set it to send a POST request with data from the SMS.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question