Example usage for android.util SparseArray setValueAt

List of usage examples for android.util SparseArray setValueAt

Introduction

In this page you can find the example usage for android.util SparseArray setValueAt.

Prototype

public void setValueAt(int index, E value) 

Source Link

Document

Given an index in the range 0...size()-1, sets a new value for the indexth key-value mapping that this SparseArray stores.

Usage

From source file:Main.java

private static void clearSparseArray(SparseArray<?> spArray) {
    if (spArray != null) {
        int size = spArray.size();
        for (int i = 0; i < size; i++) {
            spArray.setValueAt(i, null);
        }/*from w w  w .ja v a 2  s . co m*/
    }
}