Ich habe zwei Tasten: "BTN1, BTN2", die BTN2 wird sich zufällig ändern, wenn ich den Hintergrund von BTN1 Alpha ändere

Ich habe zwei Knöpfe:btn1, btn2. Sie werden mit demselben Hintergrundbild verwendet:pic1.png. Als ich den Hintergrund der ersten Schaltfläche geändert habe:btn1 imOnTouch Ereignis ist der Code wie folgt

onTouch_Action(View v, MotionEvent event) {
    if (event.getAction() == MotionEvent.ACTION_DOWN) {
        TextView tv = (TextView) v;
        int color = tv.getCurrentTextColor();
        int r = (color) & 0xFF;
        int g = (color >> 8) & 0xFF;
        int b = (color >> 16) & 0xFF;
        int a = (color >> 24) & 0xFF;
        tv.setTextColor(Color.argb(50, r, g, b)); //The other uses the same         background image buttons may also change
    } else if (event.getAction() == MotionEvent.ACTION_UP) {
        int color = tv.getCurrentTextColor();
        int r = (color) & 0xFF;
        int g = (color >> 8) & 0xFF;
        int b = (color >> 16) & 0xFF;
        int a = (color >> 24) & 0xFF;
        tv.setTextColor(Color.argb(255, r, g, b)); //The other uses the same         background image buttons may also change

    }
}

Der zweite Knopf:btn2Der Hintergrund kann auch geändert werden, und die Änderungen sind zufällig. Wie vermeide ich den zweiten Knopfwechsel?

Antworten auf die Frage(2)

Ihre Antwort auf die Frage