Answers for "how to send execution back to mainthread android java?"

1

how to run a background thread in android

Thread thread = new Thread() {
  @Override
  public void run() {
      try { Thread.sleep(2000); }
      catch (InterruptedException e) {}

      runOnUiThread(new Runnable() {
          @Override
          public void run() {
              textView.setText("OK");
          }
      });
  }
};
thread.start();
Posted by: Guest on August-11-2020

Code answers related to "how to send execution back to mainthread android java?"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language