Malaika Khan Malaika Khan -5 years ago 132
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

Answer Source

valid your JSON, using this you had a lingering "

    "JSONDataResult": {
        "contacts": [
                "country": "Pakistan",
                "sunrise": 1381107633,
                "sunset": 1381149604
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download