1/** Return the value mapped by the given key, or {@code null} if not present or null. */
2public static String optString(JSONObject json, String key)
3{
4 // http://code.google.com/p/android/issues/detail?id=13830
5 if (json.isNull(key))
6 return null;
7 else
8 return json.optString(key, null);
9}