Log.i("DEBUG", "The real id is: " + remoteViews.toString()); Thread thread = new Thread() { @Override public void run() { try { // CALL YOUR FUNCTION FROM HERE HttpRequest r = new HttpRequest("http://www.hwlogos.com/test.json"); Log.i("DEBUG", "Id is: " + remoteViews.toString()); remoteViews.setTextViewText(R.id.ip, r.GetContent()); } catch (Exception e) { e.printStackTrace(); } } }; thread.start();