本文整理汇总了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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
}
示例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;
}
}
示例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;
}
}