Code example for JSONException

Methods: toString

0
        String response = "{"+
            "\"status\": \""+(facebook.isSessionValid() ? "connected" : "unknown")+"\","+
            "\"authResponse\": {"+ 
              "\"accessToken\": \""+facebook.getAccessToken()+"\","+
              "\"expiresIn\": \""+facebook.getAccessExpires()+"\","+
              "\"session_key\": true,"+ 
              "\"sig\": \"...\","+ 
              "\"userId\": \""+this.userId+"\""+
            "}"+ 
          "}"; 
 
        try { 
            return new JSONObject(response);
        } catch (JSONException e) {
            // TODO Auto-generated catch block 
            e.printStackTrace();
        } 
        return new JSONObject();
    } 
     
    class UIDialogListener implements DialogListener {