title: android UI operation after receiving data from websocket server
body: <p>Supposet my websocket server sends <code>data</code> to my android client which is defined as given below</p>
  
  <pre><code>public class ClientConnection extends AsyncTask&lt;Void, Void, Void&gt; {
  
      private void connectWebSocket() {
          URI uri;
  
          mWebSocketClient = new WebSocketClient(uri) {
  
              @Override
              public void onOpen(ServerHandshake serverHandshake) {
              }
  
              @Override
              public void onMessage(String s) {
                                  DO_MY_UI_CHANGES(s);
              }
  
              @Override
              public void onClose(int i, String s, boolean b) {
                  Log.d("Websocket", "Closed " + s);
              }
  
              @Override
              public void onError(Exception e) {
                  Log.d("Websocket", "Error " + e.getMessage());
              }
          };
          mWebSocketClient.connect();
      }
  </code></pre>
  
  <p>Now let say I want to Update my main threads UI element after receiving data from server. As of now I know that <code>DO_MY_UI_CHANGES(s)</code> wont work because we are trying to modify main threads element in this thread which isnt allowed in android.</p>
  
  <p>Please suggest me something so that I can make call to DO_MY_UI_CHANGES.</p>