RadioGroup setOnCheckedChangeListener - top ranked examples from Open Source projects

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

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: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:removeAllViews, clearCheck, setOnCheckedChangeListener
				startingIndex);
	} 
 
	private void rebuildDisplay() { 
		RadioGroup radioGroup = (RadioGroup) findViewById(getServerListGroupId());
		radioGroup.removeAllViews();
		radioGroup.clearCheck();
 
		radioGroup.setOnCheckedChangeListener(null);
		customRadioButtonId = -1;
 
		setupRadioButtons(); 
	} 
 
	private void restoreStartingState() { 
		SharedPreferences settings = getSharedPreferences(
				LoginActivity.SERVER_URL_PREFS_SETTINGS, 
				Context.MODE_PRIVATE);
		Editor edit = settings.edit();
		edit.putInt(LoginActivity.SERVER_URL_PREFS_WHICH_SERVER,
5
CodeRank
This code example shows how to use the following methods:setOnCheckedChangeListener
 
	private RadioGroup view;
	 
	public RadioCheckBoxGroup(ComponentContainer container) {
		super(container);
		view = new RadioGroup(container.$context());
		view.setOnCheckedChangeListener(this);		
	} 
	 
	public RadioCheckBoxGroup(ComponentContainer container, int resourceId) {
		super(container, resourceId);		
		view = null;
		RadioGroup g = (RadioGroup) container.$context().findViewById(resourceId);
		g.setOnCheckedChangeListener(this);
	}	 
	 
	 
	/** 
	 *  
	 * This method is called when a radio checkbox is changed in the group. 
4
CodeRank
This code example shows how to use the following methods:setOnCheckedChangeListener
This code example shows how to use the following methods:setOnCheckedChangeListener
                                                  int resourceId,
                                                  RadioGroup.OnCheckedChangeListener listener) {
        RadioGroup ret = null;
 
        ret = findRadioGroupX(view, resourceId);
        ret.setOnCheckedChangeListener(listener);
 
        return ret;
    } 
 
 
    public static final CheckBox findCheckBox(View view, int resourceId) {
        CheckBox ret = null;
 
        ret = (CheckBox) view.findViewById(resourceId);
        if (ret == null) {
            KhandroidLog.w("Cannot find CheckBox with id = " + resourceId);
        } 
 
        return ret;
3
CodeRank
This code example shows how to use the following methods:setOnCheckedChangeListener
 
		public TabManager(FragmentActivity activity, RadioGroup tabHost, int containerId) {
			mActivity = activity;
			mTabHost = tabHost;
			mContainerId = containerId;
			mTabHost.setOnCheckedChangeListener(this);
		} 
 
		public void addTab(String tag, Class<?> clss, Bundle args, int buttonId) {
			TabInfo info = new TabInfo(tag, clss, args, buttonId);
			// Check to see if we already have a fragment for this tab, probably 
			// from a previously saved state. If so, deactivate it, because our 
			// initial state is that a tab isn't shown. 
			info.fragment = mActivity.getSupportFragmentManager().findFragmentByTag(tag);
			if (info.fragment != null && !info.fragment.isDetached()) {
				FragmentTransaction ft = mActivity.getSupportFragmentManager().beginTransaction();
				ft.detach(info.fragment);
				ft.commit();
			} 
			mTabs.put(buttonId, info);
4
CodeRank
This code example shows how to use the following methods:setOnCheckedChangeListener
    } 
 
    private void addRadioGroup(View child) {
        if (child instanceof RadioGroup) {
            RadioGroup group = (RadioGroup) child;
            groups.add(group);
            group.setOnCheckedChangeListener(groupSwitcher);
        } 
    } 
 
    @Override 
    public void addView(View child) {
        super.addView(child);
        addRadioGroup(child);
    } 
 
    @Override 
    public void addView(View child, int index) {
        super.addView(child, index);
        addRadioGroup(child);
4
CodeRank
This code example shows how to use the following methods:setOnCheckedChangeListener
	@AfterViews 
	/*package*/void initFragment() { 
		mWakeUpTime.setIs24HourView(true);
		setCurrentTime(); 
		printCurrentTimer(); 
		mTimeKind.setOnCheckedChangeListener(mTimeKindChanged);
	} 
 
	/** 
	 * セット中のタイマー時間を表示. 
	 */ 
	private void printCurrentTimer() { 
		Calendar calendar = Calendar.getInstance();
		calendar.setTimeInMillis(MyAlarmManager.getWakeUpTime());
		if (calendar.getTimeInMillis() == 0) {
			mCurrentTimer.setText(getString(R.string.timer_not_set));
			mCancelTimerButton.setVisibility(View.GONE);
		} else { 
			SimpleDateFormat sdf = new SimpleDateFormat("MM/dd HH:mm", Locale.JAPANESE);
			String time = sdf.format(calendar.getTime()) + getString(R.string.timer_setting_at);
4
CodeRank
This code example shows how to use the following methods:setOnCheckedChangeListener
		setupJpegQualitySeekBar(); 
	} 
	 
	private void setupFormatRadioGroup() { 
		RadioGroup formatRadioGroup = getFileFormatRadioGroup();
		formatRadioGroup.setOnCheckedChangeListener(this);
	} 
	 
	private RadioGroup getFileFormatRadioGroup() {
		return (RadioGroup)view.findViewById(R.id.save_as_format_radio_group);
	} 
	 
	public void onCheckedChanged(RadioGroup group, int checkedId) {
		RadioButton jpegRadioButton = getJpegRadioButton();
		if (jpegRadioButton.isChecked())
			setEnabledJpegQualityLayout(true); 
		else 
			setEnabledJpegQualityLayout(false); 
	} 
	 
4
CodeRank

Related RadioGroup setOnCheckedChangeListener Questions & Answers:

setOnCheckedChangeListener Method Overview
Register a callback to be invoked when the checked radio button changes in this group.
See Code Examples for other Android RadioGroup Methods: