Code example for SparseArray

Methods: get

0
 
    /** 
     * Returns {@code true} if the key will be handled globally. 
     */ 
    boolean shouldHandleGlobalKey(int keyCode, KeyEvent event) {
        return mKeyMapping.get(keyCode) != null;
    } 
 
    private void loadGlobalKeys(Context context) {
        XmlResourceParser parser = null;
        try { 
            parser = context.getResources().getXml(com.android.internal.R.xml.global_keys);
            XmlUtils.beginDocument(parser, TAG_GLOBAL_KEYS);
            int version = parser.getAttributeIntValue(null, ATTR_VERSION, 0);
            if (GLOBAL_KEY_FILE_VERSION == version) {
                while (true) { 
                    XmlUtils.nextElement(parser);
                    String element = parser.getName();
                    if (element == null) {
                        break; 
Experience pair programming with AI  Get Codota for Java