Android RadioGroup - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android RadioGroup class.

This code example shows how to use the following methods:check
		else if (syncSource.equals("null")) 
			id = syncNull;		
		else  
			return; 
		 
		syncGroup.check(id);
	} 
 
	@Override 
	protected void onPause() { 
		super.onPause(); 
		wizardView.saveCurrentPage();
	} 
 
	@Override 
	protected void onResume() { 
		super.onResume(); 
		 
		if(activeWizard != null)
			activeWizard.refresh();
6
CodeRank
This code example shows how to use the following methods:getCheckedRadioButtonId
	 * @return The radio button id. 
	 */ 
	public int getChecked() 
	{ 
		RadioGroup radioGroup = (RadioGroup) getView( );
		return radioGroup.getCheckedRadioButtonId();
	} 
 
	@Override 
	public int addChildAt(Widget child,int index)
	{ 
		if ( !(child instanceof RadioButtonWidget) )
		{ 
			Log.e("@@MoSync","maWidgetAddChild error: RadioGroupWidget can only add RadioButtons.");
			return IX_WIDGET.MAW_RES_INVALID_LAYOUT; 
		} 
 
		addButton((RadioButtonWidget) child);
 
		return IX_WIDGET.MAW_RES_OK; 
6
CodeRank
This code example shows how to use the following methods:setLayoutParams, setOrientation, setOnCheckedChangeListener
 
		scrollview = new PageScroller(context);
		pageview = new ScrollContents(context);
		scrollview.addView(pageview);
 
		tablist = new RadioGroup(context);
		tablist.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
			public void onCheckedChanged(RadioGroup group, int checkedId) {
				scrollview.scrollToScreen(checkedId);
			} 
		}); 
		setPadding(5, 5, 5, 5);
 
		if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
			setOrientation(LinearLayout.VERTICAL);
			tablist.setOrientation(LinearLayout.HORIZONTAL);
			tablist.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,
					LayoutParams.WRAP_CONTENT, 0));
			btnlp = new RadioGroup.LayoutParams(LayoutParams.WRAP_CONTENT,
					LayoutParams.MATCH_PARENT, 1);

6
CodeRank
This code example shows how to use the following methods:clearCheck
This code example shows how to use the following methods:setLayoutParams, addView, getCheckedRadioButtonId
        radioButton2.setText("��");
        radioButton2.setId(2);
        group1.addView(radioButton2);
         
        // RadioGroup(Group2)�𐶐����� 
        RadioGroup group2 = new RadioGroup(this);
        group2.setLayoutParams(params);
        layout.addView(group2);
         
        // Group2��RadioButton�𐶐����� 
        RadioButton radioButton3 = new RadioButton(this);
        radioButton3.setText("�I�v�V���������]����");
        radioButton3.setId(1);
        group2.addView(radioButton3);
        group2.getCheckedRadioButtonId()
         
        RadioButton radioButton4 = new RadioButton(this);
        radioButton4.setText("�I�v�V���������]���Ȃ�");
        radioButton4.setId(2);
        radioButton4.setChecked(true);

6
CodeRank
This code example shows how to use the following methods:addView, setGravity, setOrientation
        ll.setOrientation(LinearLayout.HORIZONTAL);
        ll.setGravity(Gravity.CENTER_HORIZONTAL);
        ll.addView(save);
        ll.addView(delete);
         
        RadioGroup rg = new RadioGroup(this);	//Creo un radiogroup con orientazione orizzontale su cui disporre due radiobutton
        rg.setOrientation (RadioGroup.HORIZONTAL);
        rg.setGravity(Gravity.CENTER_HORIZONTAL);
        RadioButton rb1 = new RadioButton(this);
        RadioButton rb2 = new RadioButton(this);
        TextView tv1 = new TextView (this);
        tv1.setText("M        ");
        TextView tv2 = new TextView (this);
        tv2.setText("F        ");
        rg.addView(rb1);
        rg.addView(tv1);
        rg.addView(rb2);
        rg.addView(tv2);
         
        LinearLayout ll2 = new LinearLayout (this);	//LinearLayout "finale" con orientazione verticale che contiene le altre View e ViewGroup

6
CodeRank
This code example shows how to use the following methods:clearCheck
        mChoice.setText("selected " +
                (checkedId == View.NO_ID ? "none" : checkedId));
    } 
 
    public void onClick(View v) {
        mRadioGroup.clearCheck();
    } 
} 
5
CodeRank
This code example shows how to use the following methods:addView, setOrientation, setOnCheckedChangeListener
rg.setOnCheckedChangeListener(new RadioListener(settings, sharedMode,true,id));
        		lay.addView(rg);
        		break; 
        	case 1: 
        		RadioGroup rg2 = new RadioGroup(context);
        		RadioButton rb12 = new RadioButton(context);
        		RadioButton rb22 = new RadioButton(context);
        		rb12.setText("GPS location");
        		rb22.setText("Designed location");
        		rg2.addView(rb12);
        		rg2.addView(rb22);
        		rg2.setOrientation(RadioGroup.HORIZONTAL);
        		int locationMode = (int) settings.getLong("locationMode"+id, 0);
        		if(locationMode==0){
        			rb12.setChecked(true);
        		} 
        		else{ 
        			rb22.setChecked(true);
        		} 

5
CodeRank
This code example shows how to use the following methods:check
        contentViewLayout.addView(view, contentViewLayoutParams);
    } 
     
    public void setCurrentTab(int index)
    { 
    	bottomRadioGroup.check(index);
		startGroupActivity(titleList.get(index).toString(), (Intent)intentList.get(index));
    } 
     
    public int getCurrentTab() 
    { 
    	return bottomRadioGroup.getCheckedRadioButtonId();
    } 
     
    /* 
     * gets required R, not used 
     */ 
    public boolean inflateXMLForContentView() 
    { 
    	/* 
5
CodeRank
This code example shows how to use the following methods:findViewById, indexOfChild, getCheckedRadioButtonId

Related Android RadioGroup Questions & Answers:

See Code Examples for Android RadioGroup Methods: