Hello everyone, I wanted to check the availability of the Internet in this way ... But how can I not check the onPostExecute method for it is always a false condition

  @Override protected void onPostExecute(Integer yoxlama) { super.onPostExecute(yoxlama); if (yoxlama == 1) { System.out.println("vse ok polucil svoy sttaus "); } } public int isCheck(){ try { return 0; } 

After all, I track and there code 200 everything is OK, but for some reason returns return 0;

    1 answer 1

     con.getResponseCode()!=200 

    If it is equal to 200, you return 0.

    You meant

     con.getResponseCode() == 200 
    • axaxaxaxaxa yes yes)))))) I'm confused from fatigue thanks to this)))))))))))) 0 - elik