title: Retrofit 2 - Expected BEGIN_ARRAY but was BEGIN_OBJECT
body: <p>i need to load json response into a spinner. this codes work on another activity. for example i load this on first.class and it works , so i copy and paste the code to second.class but it shows an error "EXPECTED BEGIN_ARRAY BUT WAS OBJECT"</p>
  
  <p>here's my code :</p>
  
  <p>Json response :</p>
  
  <pre><code>{
  "STATUS": "SUCCESS",
  "MESSAGE": "BOTTLE_SIZE",
  "DATA": [
      {
          "ID_BOTTLE": "1",
          "NAME_BOTTLE": "350 ML",
          "BOTTLE_VALUE": "350",
          "BOTTLE_IMAGE": "http://128.199.120.151/admin_refil/media/bottle/WhatsApp_Image_2018-08-30_at_3.51_.42_PM_.jpeg"
      },
      {
          "ID_BOTTLE": "2",
          "NAME_BOTTLE": "500 ML",
          "BOTTLE_VALUE": "500",
          "BOTTLE_IMAGE": "http://128.199.120.151/admin_refil/media/bottle/WhatsApp_Image_2018-08-30_at_3.51_.45_PM_.jpeg"
      },
      {
          "ID_BOTTLE": "3",
          "NAME_BOTTLE": "750 ML",
          "BOTTLE_VALUE": "750",
          "BOTTLE_IMAGE": "http://128.199.120.151/admin_refil/media/bottle/WhatsApp_Image_2018-08-30_at_3.51_.44_PM_.jpeg"
      },
      {
          "ID_BOTTLE": "4",
          "NAME_BOTTLE": "1 Liter",
          "BOTTLE_VALUE": "1000",
          "BOTTLE_IMAGE": "http://128.199.120.151/admin_refil/media/bottle/WhatsApp_Image_2018-08-30_at_3.51_.43_PM_.jpeg"
      }
  ]
  </code></pre>
  
  <p>}</p>
  
  <p>Json pojo :</p>
  
  <pre><code>public class ApiInformationModel {
  
  @SerializedName("STATUS")
  @Expose
  private String success; //object
  
  @SerializedName("MESSAGE")
  @Expose
  private String message;
  
  @SerializedName("DATA")
  @Expose
  private List&lt;InformationData&gt; data;
  
  public String getSuccess() {
      return success;
  }
  
  public void setSuccess(String success) {
      this.success = success;
  }
  
  public String getMessage() {
      return message;
  }
  
  public void setMessage(String message) {
      this.message = message;
  }
  
  public List&lt;InformationData&gt; getData() {
      return data;
  }
  
  public void setData(List&lt;InformationData&gt; data) {
      this.data = data;
  }
  
  public class InformationData
  {
      //bottle Size
      @SerializedName("ID_BOTTLE")
      @Expose
      private String idBottle;
  
      @SerializedName("NAME_BOTTLE")
      @Expose
      private String namebottle;
  
      @SerializedName("BOTTLE_VALUE")
      @Expose
      private String bottleValue;
  
      @SerializedName("BOTTLE_IMAGE")
      @Expose
      private String bottleImage;
  
      public String getIdBottle() {
      return idBottle;
  }
  
      public void setIdBottle(String idBottle) {
      this.idBottle = idBottle;
  }
  
      public String getNamebottle() {
      return namebottle;
  }
  
      public void setNamebottle(String namebottle) {
      this.namebottle = namebottle;
  }
  
      public String getBottleValue() {
      return bottleValue;
  }
  
      public void setBottleValue(String bottleValue) {
      this.bottleValue = bottleValue;
  }
  
      public String getBottleImage() {
      return bottleImage;
  }
  
      public void setBottleImage(String bottleImage) {
      this.bottleImage = bottleImage;
  }
  
  }
  </code></pre>
  
  <p>this is how i call my model :</p>
  
  <pre><code>public void loadBottleSize(final String bottleSizePosition) {
      informationInterface = ApiHandler.getApi(signupActivity.this).create(InformationInterface.class);
      Call&lt;ApiInformationModel&gt; signUpApi = informationInterface.getBottleSize();
      signUpApi.enqueue(new Callback&lt;ApiInformationModel&gt;() {
          @Override
          public void onResponse(Call&lt;ApiInformationModel&gt; call, Response&lt;ApiInformationModel&gt; response) {
              try {
                  if (response.isSuccessful()) {
                      if (response.body().getSuccess().equals("FAILED")) {
                          Toast.makeText(signupActivity.this, response.body().getMessage(), Toast.LENGTH_SHORT).show();
                      }
                      else {
                          List&lt;ApiInformationModel.InformationData&gt; stateItems = response.body().getData();
                          List&lt;String&gt; listSpinner = new ArrayList&lt;String&gt;();
  
                          bottleList = new String[stateItems.size()];
  
                          for (int i = 0; i &lt; stateItems.size(); i++){
                              bottleList[i] = stateItems.get(i).getBottleValue();
                              listSpinner.add(stateItems.get(i).getNamebottle());
                          }
  
                          ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(signupActivity.this,
                                  android.R.layout.simple_spinner_item, listSpinner);
                          adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                          bottleSize.setAdapter(adapter);
                      }
  
                  } else {
                      try {
                          Converter&lt;ResponseBody, ApiError&gt; converter = ApiHandler.getApi(signupActivity.this).responseBodyConverter(ApiError.class, new Annotation[0]);
                          ApiError error = converter.convert(response.errorBody());
                          Toast.makeText(signupActivity.this, "ini errornya " + error.getMessage(), Toast.LENGTH_SHORT).show();
                      } catch (Exception e) {
                          Toast.makeText(signupActivity.this, response.errorBody().string(), Toast.LENGTH_SHORT).show();
                      }
                  }
              } catch (Exception e) {
                  Toast.makeText(signupActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show();
              }
  
          }
  
          @Override
          public void onFailure(Call&lt;ApiInformationModel&gt; call, Throwable t) {
              Toast.makeText(signupActivity.this, t.getMessage(), Toast.LENGTH_SHORT).show();
          }
      });
  
  }
  </code></pre>
  
  <p>Thanks in advance!</p>