Most visited


Recently visited


Added in API level 1

JSONException

public class JSONException
extends Exception

java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ org.json.JSONException


Thrown to indicate a problem with the JSON API. Such problems include:

Although this is a checked exception, it is rarely recoverable. Most callers should simply wrap this exception in an unchecked exception and rethrow:

  public JSONArray toJSONObject() {
     
try {
         
JSONObject result = new JSONObject();
         
...
     
} catch (JSONException e) {
         
throw new RuntimeException(e);
     
}
 
}

Summary


Public constructors

JSONException(String s)

Inherited methods

From class java.lang.Throwable
From class java.lang.Object

Public constructors


JSONException

Added in API level 1
JSONException (String s)

Parameters
s String

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in English?

You requested a page in English, but your language preference for this site is English.

Would you like to change your language preference and browse this site in English? If you want to change your language preference later, use the language menu at the bottom of each page.