Code example for JSONTokener

Methods: nextValue

		abstract protected void onDownloadJsonComplete(Object object) throws JSONException;
		// Parse the text response into JSON 
		protected final void onDownloadComplete(String str) {
			JSONTokener tokener = new JSONTokener(str);
			try { 
				Object object = tokener.nextValue();
				if (object instanceof JSONObject) {
				else if (object instanceof JSONArray) {
				else { 
					onError("JSON response is an unexpected data type"); 
			} catch (JSONException e) {
				onError("JSONException while parsing response: " + e.getLocalizedMessage());
Connect your IDE to all the code out there  Get Codota for Java