How to read JSON {"success": true} in Retrofit 2? : <p>In normal <code>JSONObject jsonResponse</code>, I simply use <code>boolean success = jsonResponse.getBoolean("success");</code> . Now, I am required to use Retrofit library.
I know that the response is in GSON format. That's why I'm having a hard time figuring out how to deal with the <code>$response["success"]</code> in my <code>php</code> file.</p>

<p>I tried this:</p>

<pre><code>   call.enqueue(new Callback&lt;User_Account_Model&gt;() {
        @Override
        public void onResponse(Call&lt;User_Account_Model&gt; call, Response&lt;User_Account_Model&gt; response) {

            try {
                JSONObject jsonResponse = new JSONObject(new Gson().toJson(response));
                boolean success = jsonResponse.getBoolean("success");
                Toast.makeText(MainActivity.this,String.valueOf(success),Toast.LENGTH_SHORT).show();
            } catch (JSONException e) {
                e.printStackTrace();
            }
</code></pre>

<p>but what's inside the <code>try and catch</code> seems not to be executed. No Toast messages showing. Is my method correct and just missing something or it's completely wrong? </p>
