Applies the given value to the array of radio buttons to display it. - Android User Interface

Android examples for User Interface:RadioButton

Description

Applies the given value to the array of radio buttons to display it.

Demo Code


//package com.java2s;

import android.widget.RadioButton;

public class Main {
    /**//from ww  w.  j a  va  2 s  .  c  om
     * Applies the given value to the array of radio buttons to display it.
     * 
     * @param aValue
     *            The value do display.
     * @param aValueDisplay
     *            The radio button array.
     */
    public static void applyValue(final int aValue,
            final RadioButton[] aValueDisplay) {
        for (int i = 0; i < aValueDisplay.length; i++) {
            aValueDisplay[i].setChecked(i < aValue);
        }
    }
}

Related Tutorials