Created
May 14, 2017 23:58
-
-
Save julianfalcionelli/0a75b35f5ecc261c99b655cf24eefa20 to your computer and use it in GitHub Desktop.
Handler & Thread
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//... | |
Thread thread = new Thread(new Runnable() { | |
@Override | |
public void run() { | |
final String result = performBlockingTask(); | |
runOnUiThread(new Runnable() { | |
@Override | |
public void run() { | |
mTextView.setText(result); | |
} | |
}); | |
} | |
}); | |
thread.start(); | |
//... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment