Code example for JSONObject

Methods: getBoolean, getString, has

0
		} 
	} 
 
	private MenuInfo parseInfo(JSONObject mObject) throws JSONException {
		MenuInfo info = new MenuInfo();
		info.label = mObject.getString("label");
		info.callback = mObject.getString("action");
		if (mObject.has("icon")) {
			String tmp_uri = mObject.getString("icon");
			// I don't expect this to work at all 
			try { 
				info.icon = getIcon(tmp_uri);
			} catch (IOException e) {
				// DO NOTHING, we just don't have a file here! 
			} 
		} 
		try { 
			info.disabled = mObject.getBoolean("disabled");
		} 
		// Catch the case when "enabled" is not defined 
		catch (JSONException e) {
			Log.d("AppMenuPlugin", "DISABLED");
			info.disabled = false;