Code example for SparseIntArray

Methods: deleteindexOfValue

0
     * @param glUnused Unused GL object to ensure method is called from GL thread. 
     * @param textureHandle OpenGL texture handle to the texture to be deleted. 
     */ 
    public void deleteTextureFromGL(GL10 glUnused, int textureHandle) {
        GLES20.glDeleteTextures(0,new int[] {textureHandle},0);
        cache.delete(cache.indexOfValue(textureHandle));
    } 
 
    /** 
     * Converts an Android color to a 4-element RGBA 
     * @param color integer representing a color (generated by the Color class) 
     * @return 4-element float where every color is in the range 0-1. 
     */ 
    public static float[] splitColor(int color) {
        float[] res = new float[4];
        res[0] = Color.red(color)/255f;
        res[1] = Color.green(color)/255f;
        res[2] = Color.blue(color)/255f;
        res[3] = Color.alpha(color)/255f;
        return res;