title: Android - Kotlin : Sending a non empty jsonObject but receiving an empty one
body: <p>I am sending a json from a php file to receive via a kotlin code in android studio. 
  I write the json, before send it, to a file "test.txt" and the contents of this file after the execution is : </p>
  
  <p><strong>test.txt</strong></p>
  
  <pre><code>{"resultarray":{"result":115}}
  </code></pre>
  
  <p>The part of the <strong>php</strong> file is the following</p>
  
  <pre><code>$response = array('result' =&gt; 115);     
  $response1 = array('resultarray' =&gt; $response);
  $encoded = json_encode($response1);
  file_put_contents("test.txt",$encoded);
  header('Content-type: application/json');
  exit($encoded);
  </code></pre>
  
  <p>The <strong>Post</strong> class I am using is the following : </p>
  
  <pre><code>class Post {
  
  @SerializedName("resultarray")
  @Expose
  public var resultarray: JSONObject? = null
  
  
  override fun toString(): String {
     if (resultarray == null )
      {
          return " 'resultarray' is null"
  
      }else {
          val entries = resultarray?.keys() 
          if (entries == null) {
              return " 'entries' is null"
          }else {
              var tostr = "start"
              for (entry in entries) {
                  var whatweget  = resultarray?.get(entry)
                  if(whatweget != null) {
                      tostr += " " + whatweget
                  }
              }
              return tostr + "end"
          }
      }
  </code></pre>
  
  <p>When the above segment of code is executed the resulted string is </p>
  
  <pre><code>startend
  </code></pre>
  
  <p>I don't know how to take the 'result' field which is equivalent to understand how to take a jsonobject from inside a jsonobject. 
  Also the <strong>resultarray</strong> is equal with "{}". So the problem maybe is with the annotation of the <strong>resultarray</strong>.</p>
  
  <p>Thanks in advance</p>