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

This code example shows how to use the following methods: append
            ctv.setTypeface(roboto.getTypeface(position));
            ctv.setOnClickListener(new OnClickListener() {
                @Override 
                public void onClick(View v) {
                    ctv.toggle();
                    checked.append(position, ctv.isChecked());
                } 
            }); 
            return view;
        } 
 
    } 
 
} 
Full Snippet Info
5
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: clear, get, put, size, valueAt
     * 
     * @see #setChoiceMode(int) 
     */ 
    public boolean isItemChecked(int position) {
        if (mChoiceMode != CHOICE_MODE_NONE && mCheckStates != null) {
            return mCheckStates.get(position);
        } 
 
        return false; 
    } 
 
    /** 
     * Returns the set of checked items in the list. The result is only valid if 
     * the choice mode has not been set to {@link #CHOICE_MODE_NONE}. 
     * 
     * @return  A SparseBooleanArray which will return true for each call to 
     *          get(int position) where position is a position in the list, 
     *          or <code>null</code> if the choice mode is set to 
     *          {@link #CHOICE_MODE_NONE}. 
     */ 

5
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:
import android.util.SparseBooleanArray; 
 
public class ItemPositionsObservable extends 
	ObservableCollection<Boolean>{
	 
	private SparseBooleanArray arr = new SparseBooleanArray();
 
	public Boolean getItem(int position) {
		return arr.valueAt(position);
	} 
 
	public void onLoad(int position) {
	} 
 
	public Class<Boolean> getComponentType() {
		return Boolean.class;
	} 
 
	public int size() { 
		return arr.size();
Full Snippet Info
5
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: delete, get
		return super.onKeyDown(keyCode, event);
	} 
 
	@Override 
	public boolean onKeyUp(int keyCode, KeyEvent event) {
		if( event.getAction() == KeyEvent.ACTION_UP && pressed_key.get(keyCode) ){
			pressed_key.delete(keyCode);
			switch(keyCode){
			case KeyEvent.KEYCODE_BACK:
				procBackKey(); 
				return true; 
			case KeyEvent.KEYCODE_MENU:
				procMenuKey(); 
				return true; 
			} 
		} 
		return super.onKeyUp(keyCode, event);
	} 
	 
	protected void  procMenuKey() { 
Full Snippet Info
5
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: get, put
        } 
        return v;
    } 
 
    public boolean isChecked(int position) {
        return mCheckStates.get(position, false);
    } 
 
    public void setChecked(int position, boolean isChecked) {
        mCheckStates.put(position, isChecked);
        notifyDataSetChanged();
    } 
 
    public void toggle(int position) {
        setChecked(position, !isChecked(position));
    } 
 
    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
        mCheckStates.put((Integer) buttonView.getTag(), isChecked);
    } 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android SparseBooleanArray Questions & Answers:

See Code Examples for Android SparseBooleanArray Methods: