Malaika Khan Malaika Khan - 7 months ago 39
Android Question

JSON Cannot viewed in Listview, Getting Error, Unterminated Exceptions

I want to show data in listview and I am getting error. How to Show data in ListView.
THis is my newstring variable


and my error is in this line after this line i got exception in code

JSONObject jsonObj = new JSONObject(newString);

and my error in logcat is

01-15 15:39:17.050: W/System.err(731): org.json.JSONException: Unterminated object at character 22 of {"JSONDataResult":"{"contacts":[{"country":"Pakistan","sunrise":1381107633,"sunset":1381149604}]}"}

Thanks for your help


valid your JSON, using this you had a lingering "

    "JSONDataResult": {
        "contacts": [
                "country": "Pakistan",
                "sunrise": 1381107633,
                "sunset": 1381149604