Android CheckBox - 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 CheckBox class.

This code example shows how to use the following methods: isChecked
		assertEquals( null, androidWidgetBuilder.getValue( new View( null ) ) );
		assertFalse( androidWidgetBuilder.setValue( null, null ) );
 
		// CheckBox 
 
		CheckBox checkBox = new CheckBox( null );
		assertTrue( false == (Boolean) androidWidgetBuilder.getValue( checkBox ) );
		androidWidgetBuilder.setValue( true, checkBox );
		assertTrue( checkBox.isChecked() );
		assertTrue( true == (Boolean) androidWidgetBuilder.getValue( checkBox ) );
 
		// TextView 
 
		TextView textView = new TextView( null );
		assertEquals( null, androidWidgetBuilder.getValue( textView ) );
		androidWidgetBuilder.setValue( "foo", textView );
		assertEquals( "foo", textView.getText() );
		assertEquals( "foo", androidWidgetBuilder.getValue( textView ) );
 
		textView.setText( new SpannableStringBuilder( "foo" ) );
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setId, setLayoutParams, setChecked, setOnCheckedChangeListener
				RelativeLayout.LayoutParams.WRAP_CONTENT,
				RelativeLayout.LayoutParams.WRAP_CONTENT);
		checkboxparams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
		checkboxparams.addRule(RelativeLayout.CENTER_VERTICAL);
 
		checkbox = new CheckBox(getContext());
		checkbox.setLayoutParams(checkboxparams);
		checkbox.setOnCheckedChangeListener(this);
		checkbox.setId(CHECKBOX_ID);
		 
		 
 
		layout.addView(title);
		layout.addView(description);
		layout.addView(checkbox);
		layout.setId(android.R.id.widget_frame);
 
		checkService(); 
		 
		return layout;

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: isChecked, setChecked
    public FileItemInfoLayout(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    } 
 
    public void toggle() { 
        setChecked(!mCheckbox.isChecked());
    } 
 
    /* (non-Javadoc) 
     * @see android.view.View#onFinishInflate() 
     */ 
    @Override 
    protected void onFinishInflate() { 
        super.onFinishInflate(); 
        mFileNameView = (TextView) findViewById(R.id.misc_filename);
        mFileSizeView = (TextView) findViewById(R.id.misc_filesize);
        mCheckbox = (CheckBox) findViewById(R.id.misc_checkbox);
    } 
 
    public void setFileName(String fileName) {

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: isChecked
 
	@Override 
	public void onAccept() { 
		super.onAccept(); 
		AccountManager.getInstance().setPassword(account,
				storePasswordView.isChecked(),
				passwordView.getText().toString());
		finish(); 
	} 
 
	@Override 
	public void onDecline() { 
		AccountManager.getInstance().removePasswordRequest(account);
		finish(); 
	} 
 
	public static Intent createIntent(Context context, String account) {
		return new AccountIntentBuilder(context, PasswordRequest.class)
				.setAccount(account).build();
	} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setChecked
        mCheckBox = (CheckBox) findViewById(R.id.check);
    } 
 
    @Override 
    public void setChecked(boolean checked) {
        mCheckBox.setChecked(checked);
    } 
 
    @Override 
    public boolean isChecked() { 
        return mCheckBox.isChecked();
    } 
 
    @Override 
    public void toggle() { 
        mCheckBox.toggle();
    } 
} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android CheckBox Questions & Answers:

Other Android CheckBox Examples

1:	public void onCheckboxClicked(View view) {
2:	    // Is the view now checked?
3:	    boolean checked = ((CheckBox) view).isChecked();
4:	    
5:	    // Check which checkbox was clicked

Read More

See Code Examples for Android CheckBox Methods: