当前位置: 首页>>代码示例>>Java>>正文


Java RadioGroup.getCheckedRadioButtonId方法代码示例

本文整理汇总了Java中android.widget.RadioGroup.getCheckedRadioButtonId方法的典型用法代码示例。如果您正苦于以下问题:Java RadioGroup.getCheckedRadioButtonId方法的具体用法?Java RadioGroup.getCheckedRadioButtonId怎么用?Java RadioGroup.getCheckedRadioButtonId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.RadioGroup的用法示例。


在下文中一共展示了RadioGroup.getCheckedRadioButtonId方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findSelectedDuration

import android.widget.RadioGroup; //导入方法依赖的package包/类
public int findSelectedDuration(View view) {
	RadioGroup radioGroup = (RadioGroup) view.findViewById(R.id.stroke_dlg_duration_group);
	int radioButtonId = radioGroup.getCheckedRadioButtonId();
	if( radioButtonId != -1 ) {
		RadioButton radioButton = (RadioButton) radioGroup.findViewById(radioButtonId);
		if( radioButton != null ) {
			return ((Integer)radioButton.getTag()).intValue();
		}
	}
	return 0;
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:12,代码来源:TGStrokeDialog.java

示例2: riskButtonListener

import android.widget.RadioGroup; //导入方法依赖的package包/类
public void riskButtonListener(View v) {
    RadioGroup radioGroup = (RadioGroup) findViewById(R.id.radio_group);
    RadioButton radioButton = (RadioButton) findViewById(R.id.radio_yes);
    TextView message = (TextView) findViewById(R.id.risk_validation);
    if (radioGroup.getCheckedRadioButtonId() != -1) {
        message.setVisibility(View.INVISIBLE);
        mRisk = radioGroup.getCheckedRadioButtonId()
                == radioButton.getId();
        nextPage();
    } else {
        message.setVisibility(View.VISIBLE);
    }
}
 
开发者ID:ArnauBlanch,项目名称:civify-app,代码行数:14,代码来源:CreateIssueActivity.java

示例3: findSelectedMeasureNumber

import android.widget.RadioGroup; //导入方法依赖的package包/类
public int findSelectedMeasureNumber(View view) {
	RadioGroup optionsGroup = (RadioGroup) view.findViewById(R.id.measure_add_dlg_options_group);
	
	int radioButtonId = optionsGroup.getCheckedRadioButtonId();
	if( radioButtonId != -1 ) {
		RadioButton radioButton = (RadioButton) optionsGroup.findViewById(radioButtonId);
		if( radioButton != null ) {
			return ((Integer)radioButton.getTag()).intValue();
		}
	}
	return 1;
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:13,代码来源:TGMeasureAddDialog.java

示例4: findSelectedOnBeat

import android.widget.RadioGroup; //导入方法依赖的package包/类
public boolean findSelectedOnBeat(View view) {
	RadioGroup radioGroup = (RadioGroup) view.findViewById(R.id.grace_dlg_position_group);
	int radioButtonId = radioGroup.getCheckedRadioButtonId();
	if( radioButtonId != -1 ) {
		RadioButton radioButton = (RadioButton) radioGroup.findViewById(radioButtonId);
		if( radioButton != null ) {
			return ((Boolean)radioButton.getTag()).booleanValue();
		}
	}
	return false;
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:12,代码来源:TGGraceDialog.java

示例5: findSelectedOption

import android.widget.RadioGroup; //导入方法依赖的package包/类
public int findSelectedOption(RadioGroup radioGroup, int defaultValue) {
	int radioButtonId = radioGroup.getCheckedRadioButtonId();
	if( radioButtonId != -1 ) {
		RadioButton radioButton = (RadioButton) radioGroup.findViewById(radioButtonId);
		if( radioButton != null ) {
			return ((Integer)radioButton.getTag()).intValue();
		}
	}
	return defaultValue;
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:11,代码来源:TGGraceDialog.java

示例6: parseApplyTo

import android.widget.RadioGroup; //导入方法依赖的package包/类
public Integer parseApplyTo(RadioGroup radioGroup, Integer defaultValue) {
	int radioButtonId = radioGroup.getCheckedRadioButtonId();
	if( radioButtonId != -1 ) {
		RadioButton radioButton = (RadioButton) radioGroup.findViewById(radioButtonId);
		if( radioButton != null ) {
			return ((Integer)radioButton.getTag()).intValue();
		}
	}
	return defaultValue;
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:11,代码来源:TGTempoDialog.java

示例7: findSelectedHarmonic

import android.widget.RadioGroup; //导入方法依赖的package包/类
public int findSelectedHarmonic(View view) {
	RadioGroup radioGroup = (RadioGroup) view.findViewById(R.id.harmonic_dlg_type_group);
	int radioButtonId = radioGroup.getCheckedRadioButtonId();
	if( radioButtonId != -1 ) {
		RadioButton radioButton = (RadioButton) radioGroup.findViewById(radioButtonId);
		if( radioButton != null ) {
			return ((Integer)radioButton.getTag()).intValue();
		}
	}
	return TGEffectHarmonic.TYPE_NATURAL;
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:12,代码来源:TGHarmonicDialog.java

示例8: findSelectedDuration

import android.widget.RadioGroup; //导入方法依赖的package包/类
public int findSelectedDuration(View view) {
	RadioGroup optionsGroup = (RadioGroup) view.findViewById(R.id.trill_dlg_duration_group);
	
	int radioButtonId = optionsGroup.getCheckedRadioButtonId();
	if( radioButtonId != -1 ) {
		RadioButton radioButton = (RadioButton) optionsGroup.findViewById(radioButtonId);
		if( radioButton != null ) {
			return ((Integer)radioButton.getTag()).intValue();
		}
	}
	return TGDuration.EIGHTH;
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:13,代码来源:TGTrillDialog.java

示例9: findSelectedDuration

import android.widget.RadioGroup; //导入方法依赖的package包/类
public int findSelectedDuration(View view) {
	RadioGroup optionsGroup = (RadioGroup) view.findViewById(R.id.tremolo_picking_dlg_duration_group);
	
	int radioButtonId = optionsGroup.getCheckedRadioButtonId();
	if( radioButtonId != -1 ) {
		RadioButton radioButton = (RadioButton) optionsGroup.findViewById(radioButtonId);
		if( radioButton != null ) {
			return ((Integer)radioButton.getTag()).intValue();
		}
	}
	return TGDuration.EIGHTH;
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:13,代码来源:TGTremoloPickingDialog.java

示例10: parseTripletFeelValue

import android.widget.RadioGroup; //导入方法依赖的package包/类
public Integer parseTripletFeelValue(RadioGroup radioGroup) {
	int radioButtonId = radioGroup.getCheckedRadioButtonId();
	if( radioButtonId != -1 ) {
		RadioButton radioButton = (RadioButton) radioGroup.findViewById(radioButtonId);
		if( radioButton != null ) {
			return ((Integer)radioButton.getTag()).intValue();
		}
	}
	return TGMeasureHeader.TRIPLET_FEEL_NONE;
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:11,代码来源:TGTripletFeelDialog.java

示例11: setResult

import android.widget.RadioGroup; //导入方法依赖的package包/类
void setResult() {
    EditText et = (EditText)findViewById(R.id.age);
    String checkEmpty = et.getText().toString();

    RadioGroup rg = (RadioGroup)findViewById(R.id.gender);
    RadioGroup rg2 = (RadioGroup)findViewById(R.id.reoccur);

    RadioButton rb1 = (RadioButton)findViewById(R.id.male);
    RadioButton rb2 = (RadioButton)findViewById(R.id.yes);

    NumberPicker numberPicker = (NumberPicker) findViewById(R.id.numberPicker);
    NumberPicker stringPicker = (NumberPicker) findViewById(R.id.stringPicker);

    Intent intent = new Intent();

    if (checkEmpty.matches("")){
        Toast.makeText(AgeScreen.this, "Age not set!",
                Toast.LENGTH_LONG).show();
        setResult(RESULT_CANCELED, intent);
    } else if (rg.getCheckedRadioButtonId() == -1) {
        Toast.makeText(AgeScreen.this, "Gender not selected!",
                Toast.LENGTH_LONG).show();
        setResult(RESULT_CANCELED, intent);
    } else if (rg2.getCheckedRadioButtonId() == -1) {
        Toast.makeText(AgeScreen.this, "Recurrence not selected!",
                Toast.LENGTH_LONG).show();
        setResult(RESULT_CANCELED, intent);
    } else {
        //age
        intent.putExtra("age",Integer.parseInt(checkEmpty));

        //gender
        if (rb1.isChecked())
            intent.putExtra("gender","male");
        else
            intent.putExtra("gender","female");

        //reoccurring
        if (rb2.isChecked())
            intent.putExtra("reoccurring",true);
        else
            intent.putExtra("reoccurring",false);

        //days
        int days = numberPicker.getValue();
        int date = stringPicker.getValue();
        if (date == 2)
            days *= 28; //months selected
        else if (date == 3)
            days *= 365; //years selected
        intent.putExtra("days",days);

        setResult(RESULT_OK, intent);
    }

    finish();
}
 
开发者ID:smajko,项目名称:what_are_those_app,代码行数:58,代码来源:AgeScreen.java

示例12: nextClickSetup1

import android.widget.RadioGroup; //导入方法依赖的package包/类
public void nextClickSetup1(View view){


        RadioGroup firstSelection = (RadioGroup) findViewById(R.id.firstSelectionRadioGroup);

        int selected = firstSelection.getCheckedRadioButtonId();

        // Preparing Fragment
        FragmentTransaction transaction = getFragmentManager().beginTransaction();

        switch (selected) {
            case R.id.customRadio:


                // SetupStep2CustomFragment is the fragment for Custom Setup
                SetupStep2CustomFragment custom = new SetupStep2CustomFragment();
                // Finally MainFragment is added to the main container
                transaction.replace(R.id.fragment_container, custom);

                transaction.addToBackStack("");
                transaction.commit();
                break;

            case R.id.defaultRadio:
                // SetupStep2DefaultFragment is the fragment for the 1n.pm Setup
                SetupStep2DefaultFragment npm = new SetupStep2DefaultFragment();
                // Finally MainFragment is added to the main container
                transaction.replace(R.id.fragment_container, npm);

                transaction.addToBackStack("");
                transaction.commit();
                break;

            case R.id.keepRadio:
                // We simply set a bool to sharedprefs that tells us to keep the prefs.
                // Also we Intent back to the MainActivity
                Intent intent = new Intent(this, MainActivity.class);
                startActivity(intent);
                break;
        }



    }
 
开发者ID:michaelachmann,项目名称:LnkShortener,代码行数:45,代码来源:SetupActivity.java

示例13: nextClickSetup2Default

import android.widget.RadioGroup; //导入方法依赖的package包/类
public void nextClickSetup2Default(View view){

        RadioGroup firstSelection = (RadioGroup) findViewById(R.id.npmRadioGroup);

        int selected = firstSelection.getCheckedRadioButtonId();

        // Preparing Fragment
        FragmentTransaction transaction = getFragmentManager().beginTransaction();

        switch (selected) {
            case R.id.radioAnonymous:
                // If this option is selected we want to setup an anonymous Account. Therefore We
                // Swap to the loading fragment and start signUpAnonymously()

                SetupFinalStepLoading anon = new SetupFinalStepLoading();

                // We send two pieces of information to anon: 1) statustext, 2) statusspinner
                Bundle bundle = new Bundle();
                bundle.putString("statuspercent", getString(R.string.setup_creating_uuid));

                // Add bundle to  anon
                anon.setArguments(bundle);

                // Ready for transaction
                transaction.replace(R.id.fragment_container, anon);
                transaction.addToBackStack("");
                transaction.commit();

                // Fragment changed, now we start the async Volley call.
                signUpAnonymously();

                break;
            case R.id.radioLogin:
                //
                SetupStep3LoginFragment login = new SetupStep3LoginFragment();
                //
                transaction.replace(R.id.fragment_container, login);

                transaction.addToBackStack("");
                transaction.commit();
                break;
        }



    }
 
开发者ID:michaelachmann,项目名称:LnkShortener,代码行数:47,代码来源:SetupActivity.java

示例14: onCheckedChanged

import android.widget.RadioGroup; //导入方法依赖的package包/类
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
    int checkedRadioButtonId = group.getCheckedRadioButtonId();
    switch (checkedRadioButtonId) {
        case R.id.radio_smooth_definition:
            //360p
            mSeekBarlv.setText(440 + "");
            sb_mlv.setProgress(440);
            zhenSeekBarlv.setText("(20)");
            sb_zlv.setProgress(20);
            initBitrate = 440;
            bestBitrate = 440;
            maxBitrate = 500;
            frameRate = 20;
            resolution360button.setBackgroundResource(R.drawable.push_params_set_click_btn);
            resolution480button.setBackgroundResource(R.drawable.push_params_set_normal_btn);
            resolution720button.setBackgroundResource(R.drawable.push_params_set_normal_btn);
            resolution540button.setBackgroundResource(R.drawable.push_params_set_normal_btn);
            break;
        case R.id.radio_standard_definition:
            //480p
            mSeekBarlv.setText(800 + "");
            sb_mlv.setProgress(800);
            zhenSeekBarlv.setText("(25)");
            sb_zlv.setProgress(25);
            initBitrate = 800;
            bestBitrate = 800;
            maxBitrate = 1000;
            frameRate = 25;
            resolution360button.setBackgroundResource(R.drawable.push_params_set_normal_btn);
            resolution480button.setBackgroundResource(R.drawable.push_params_set_click_btn);
            resolution720button.setBackgroundResource(R.drawable.push_params_set_normal_btn);
            resolution540button.setBackgroundResource(R.drawable.push_params_set_normal_btn);
            break;
        case R.id.radio_super_definition:
            //720p
            mSeekBarlv.setText(1200 + "");
            sb_mlv.setProgress(1200);
            zhenSeekBarlv.setText("(30)");
            sb_zlv.setProgress(30);
            initBitrate = 1200;
            bestBitrate = 1200;
            maxBitrate = 1400;
            frameRate = 30;
            resolution360button.setBackgroundResource(R.drawable.push_params_set_normal_btn);
            resolution480button.setBackgroundResource(R.drawable.push_params_set_normal_btn);
            resolution720button.setBackgroundResource(R.drawable.push_params_set_click_btn);
            resolution540button.setBackgroundResource(R.drawable.push_params_set_normal_btn);
            break;
        case R.id.radio_high_definition:
            //540p
            mSeekBarlv.setText(1000 + "");
            sb_mlv.setProgress(1000);
            zhenSeekBarlv.setText("(30)");
            sb_zlv.setProgress(30);
            initBitrate = 1000;
            bestBitrate = 1200;
            frameRate = 30;
            resolution360button.setBackgroundResource(R.drawable.push_params_set_normal_btn);
            resolution480button.setBackgroundResource(R.drawable.push_params_set_normal_btn);
            resolution720button.setBackgroundResource(R.drawable.push_params_set_normal_btn);
            resolution540button.setBackgroundResource(R.drawable.push_params_set_click_btn);
            break;
    }
}
 
开发者ID:JunGeges,项目名称:AliZhiBoHao,代码行数:66,代码来源:PushParamsActivity.java


注:本文中的android.widget.RadioGroup.getCheckedRadioButtonId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。