Convert JSONobjects to int and object
<p>My android app is communicating with a webservice which returns to 2 values in one JSONObject, an integer and an object. But somehow I just can't seem to convert them to back to an int and an object.</p>

<p>The value I am retrieving with my <code>JSONObject</code>:    </p>

<pre><code>{"d":{"__type":"Datalayer.User","med_ID":24,"geb_GUID":"8bb4894b-92f7-45af-9a40-b99d7a06a506"}}
</code></pre>

<p>and this is the code I am using:</p>

<pre><code> public class TUser {

    // Publics
    public int UserID;
    public String Username;
    public String Password;
    public String License;
    public String DeviceId;
    public Boolean Authenticated;
    public Object gebGUID;

    SharedPreferences prefs;

    // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //   

    public TUser()
    {
        this.UserID = -1;
        this.Username = "";
        this.Password = "";
        this.License = "";
        this.DeviceId = "123";
        this.Authenticated = false;
        this.gebGUID = null;
    }

    // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //   

    public void AuthenticateUser(Context context) {

        // Vars
        JSONObject inputObject = new JSONObject();
        StringEntity seParams = null;
        JSONObject output = null;
        String result = "0";

        //standaard waarde
        this.Authenticated = false;

        // Create JSONObject with all the needed parameters for this call
        try {
            inputObject.put("UserName", this.Username);
            inputObject.put("Password", this.Password);
            inputObject.put("License", this.License);
            inputObject.put("DeviceId", this.DeviceId);

            seParams = new StringEntity(inputObject.toString());
        } catch (Exception e) {
            TLogFile.appendLog("e", "log_tag", "Error creating object " + e.toString());
        }


        // Create the HTTPRequest
        TWebserviceHelper h = new TWebserviceHelper();
        result = h.ExecuteAction(context, seParams,  "/Login", 10000, 10000);

        //bij geen result gaan we ook niet parsen
        if (result == "")
        {
            return;
        }

        //try parse the string to a JSON object
        try{
            output = new JSONObject(result);
        }catch(JSONException e){
            TLogFile.appendLog("e", "log_tag", "Error parsing data "+e.toString());
        }

        try {
            this.UserID = output.getInt("d");
            this.gebGUID = output.get("geb_GUID");
            if (this.UserID != 0){
                this.Authenticated = true;
            }else{
                this.Authenticated = false;
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }
}
</code></pre>

<p>I hope that you guys see the problem. Thanks in advance</p>
