Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Disons que ta méthode qui va retourner ton string s'appelle makeHttpRequest
- tu fais une méthode
- public JSONObject toJSONObject(String value)
- {
- try
- {
- JSONObject o = new JSONObject(value);
- }
- catch(Exception e)
- {
- JSONArray a = new JSONArray(value);
- JSONObject o = a.toJSONObject();
- }
- finally
- {
- return o;
- }
- }
- et dans ton code tu peux faire
- JSONObject monJSON = toJSONObject(makeHttpRequest());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement