SparseBooleanArray size - top ranked examples from Open Source projects

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

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
This code example shows how to use the following methods:size
	public Class<Boolean> getComponentType() {
		return Boolean.class;
	} 
 
	public int size() { 
		return arr.size();
	} 
	 
	public void clear(){ 
		CollectionChangedEventArg arg = new CollectionChangedEventArg(Action.Reset);
		arr.clear();
		notifyCollectionChanged(arg);
	} 
	 
	public void put(int key, boolean value){
		arr.put(key, value);
		notifyCollectionChanged(new CollectionChangedEventArg(Action.Add, key));
	} 
	 
	public void putAll(Map<Integer, Boolean> values){
5
CodeRank
This code example shows how to use the following methods:size
    } 
 
    private void updateWindowIndeterminateProgress() { 
        // Show an indeterminate progress spinner when something is loading, 
        // unless the main loading view is already visible. 
        mWindow.setFeatureInt(Window.FEATURE_INDETERMINATE_PROGRESS, mActive.size() != 0
                && mLoading.getVisibility() != View.VISIBLE ? Window.PROGRESS_VISIBILITY_ON
                : Window.PROGRESS_VISIBILITY_OFF);
    } 
 
    private boolean isEmpty() { 
        // Don't use AdapterView#getCount() because it is updated asynchronously 
        Adapter adapter = mAdapterView.getAdapter();
        return adapter == null || adapter.isEmpty();
    } 
 
    private static boolean hasError(Cursor data) {
        return data == null || data.getExtras().containsKey(FeedExtras.EXTRA_ERROR);
    } 
} 
4
CodeRank
This code example shows how to use the following methods:keyAt, size
    public int getCheckedItemPosition() { 
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            return super.getCheckedItemPosition(); 
        } 
         
        if (mChoiceMode == CHOICE_MODE_SINGLE && mCheckStates != null && mCheckStates.size() == 1) {
            return mCheckStates.keyAt(0);
        } 
         
        return INVALID_POSITION;
    } 
     
    @SuppressLint("NewApi") 
    @Override 
    public SparseBooleanArray getCheckedItemPositions() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            return super.getCheckedItemPositions(); 
        } 
         
        if (mChoiceMode != CHOICE_MODE_NONE) {
4
CodeRank
This code example shows how to use the following methods:size
 
    /** 
     * {@inheritDoc} 
     */ 
    public int getSelectedCount() { 
        return selectedItems.size();
    } 
 
    /** 
     * {@inheritDoc} 
     */ 
    public SparseBooleanArray getSelectedItems() {
        return selectedItems;
    } 
 
    /** 
     * {@inheritDoc} 
     */ 
    @Override 
    public View getView(final int position, View convertView, final ViewGroup parent) {
3
CodeRank

Related SparseBooleanArray size Questions & Answers:

size Method Overview
Returns the number of key-value mappings that this SparseBooleanArray currently stores.
See Code Examples for other Android SparseBooleanArray Methods: