I am a newbie to JSON . So If this is a very basic doubt don\'t scold me . I have a JSON Object Reference and I want to get the Key(Object has only one Key Value Pair) . How
You can use jsonObject.keys() for getting all keys. Then you may iterate over keys to get the first key out of them like :
jsonObject.keys()
Iterator keys = jsonObject.keys(); if( keys.hasNext() ){ String key = (String)keys.next(); // First key in your json object }