Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * A simple executor which passes tasks to the main UI thread for execution.
- * Use this if your task needs to interact with the view hierarchy, such as
- * updating displayed values, sending intents, etc.
- *
- * @author mrenouf@google.com (Mark Renouf)
- *
- */
- public class UiThreadExecutor implements Executor {
- private final Handler handler;
- public UiThreadExecutor() {
- this.handler = new Handler(Looper.getMainLooper());
- }
- @Override
- public void execute(Runnable command) {
- handler.post(command);
- }
- }
Add Comment
Please, Sign In to add comment