*** implementation new Thread(new Runnable() { public void run() { HashMap params = new HashMap(); params.put("param1", "1"); HttpURLConnection connection = null; try { URL url = new URL("http://xxxxx.com/api/xxxx"); connection = (HttpURLConnection)url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("Accept", "application/json"); connection = ConnectionManager.setParams(connection, params); connection.connect(); Integer responseCode = connection.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK) { activity.runOnUiThread(new Runnable(){ @Override public void run() { //refresh GUI } }); } }catch(Exception e){ e.printStackTrace(); }f