title: No response from url in Retrofit Parsing
body: <p>I am implementing the json parsing using retrofit but I didnot get any response from url. The Json data is in the form of Array inside which there are objects.I tried to set the response coming from Url in the TextView. I have implemented as follows:</p>
  
  <p>My JSON structure is as follows:</p>
  
  <pre><code>[{
      "id": "2",
      "name": "Nbn",
      "code": "001",
      "ecozone": "ter",
      "devregion": "east"
  },
  {
      "id": "3",
      "name": "hari",
      "code": "002",
      "ecozone": "hill",
      "devregion": "west"
  }
  ]
  </code></pre>
  
  <p>Api Service</p>
  
  <pre><code>public interface ApiService {
  @GET("/data_new.php?q=district")
  Call&lt;District&gt; getMyJSON();
  }
  </code></pre>
  
  <p>RetrofitClient</p>
  
  <pre><code>public class RetrofitClient {
  private static final String url = "url/";
  
  private static Retrofit getRetrofitInstance() {
      OkHttpClient client=new OkHttpClient();
      return new Retrofit.Builder()
              .baseUrl(url)
              .client(client)
              .addConverterFactory(GsonConverterFactory.create())
              .build();
  }
  public static ApiService getApiService(){
      return getRetrofitInstance().create(ApiService.class);
  }
  }
  </code></pre>
  
  <p>My ModelDto class</p>
  
  <pre><code>public class DistrictDTO {
  @SerializedName("id")
  @Expose
  String id;
  
  public String getId() {
      return id;
  }
  
  public void setId(String id) {
      this.id = id;
  }
  
  @SerializedName("name")
  @Expose
  String name;
  
  public String getName() {
      return name;
  }
  
  public void setName(String name) {
      this.name = name;
  }
  
  @SerializedName("code")
  @Expose
  String code;
  
  public String getCode() {
      return code;
  }
  
  public void setCode(String code) {
      this.code = code;
  }
  
  @SerializedName("ecozone")
  @Expose
  String ecozone;
  
  public String getEcozone() {
      return ecozone;
  }
  
  public void setEcozone(String ecozone) {
      this.ecozone = ecozone;
  }
  
  @SerializedName("devregion")
  @Expose
  String devregion;
  
  public String getDevregion() {
      return devregion;
  }
  
  public void setDevregion(String devregion) {
      this.devregion = devregion;
  }
  
  
  }
  </code></pre>
  
  <p>DistrictDTO</p>
  
  <pre><code>public class District {
  public ArrayList&lt;DistrictDTO&gt; districtDTOS;
  
  public ArrayList&lt;DistrictDTO&gt; getDistrictDTOS() {
      return districtDTOS;
  }
  
  public void setDistrictDTOS(ArrayList&lt;DistrictDTO&gt; districtDTOS) {
      this.districtDTOS = districtDTOS;
  }
  }
  </code></pre>
  
  <p>And Activity </p>
  
  <pre><code>public class DistrictActivity extends AppCompatActivity {
  private ArrayList&lt;DistrictDTO&gt; district;
  private TextView textView;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_district);
      district = new ArrayList&lt;&gt;();
      textView = (TextView) findViewById(R.id.textVi);
      ApiService api = RetrofitClient.getApiService();
      retrofit2.Call&lt;District&gt; call = api.getMyJSON();
      call.enqueue(new Callback&lt;District&gt;() {
          @Override
          public void onResponse(retrofit2.Call&lt;District&gt; call, Response&lt;District&gt; response) {
  
              if (response.isSuccessful()) {
                  //got successfully
                  district = response.body().getDistrictDTOS();
                  Log.e("Respose", "" + district);
                  textView.setText(response.body().getDistrictDTOS().toString());
              }
          }
          @Override
          public void onFailure(retrofit2.Call&lt;District&gt; call, Throwable t) {
  
              t.fillInStackTrace();
          }
      });
  }
  
  }
  </code></pre>