Code example for SharedPreferences

Methods: getAll

                msg.put("key", key);
                // Truly, this is awful, but the API impedence is strong: there 
                // is no way to get a single untyped value from a 
                // SharedPreferences instance. 
                msg.put("value", sharedPreferences.getAll().get(key));
                GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("SharedPreferences:Changed", msg.toString()));
            } catch (JSONException e) {
                Log.e(LOGTAG, "Got exception creating JSON object", e);
     * Register or unregister a SharedPreferences.OnSharedPreferenceChangeListener. 
     * message.branch must exist, and should be a String SharedPreferences 
     * branch name, or null for the default branch.