Code example for SparseIntArray

Methods: size

0
        public float getAxisValue(int axisIndex) {
            return mAxisValues[axisIndex];
        } 
 
        public int getKeyCount() { 
            return mKeys.size();
        } 
 
        public int getKeyCode(int keyIndex) {
            return mKeys.keyAt(keyIndex);
        } 
 
        public boolean isKeyPressed(int keyIndex) {
            return mKeys.valueAt(keyIndex) != 0;
        } 
 
        public boolean onKeyDown(KeyEvent event) {
            final int keyCode = event.getKeyCode();
            if (isGameKey(keyCode)) {
                if (event.getRepeatCount() == 0) {
                    final String symbolicName = KeyEvent.keyCodeToString(keyCode);