Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.view.View;

public class Main {
    public static void runOnViewThread(View view, Runnable runnable) {
        if (view.getHandler() == null || view.getHandler().getLooper() == null
                || view.getHandler().getLooper().getThread() == Thread.currentThread()) {
            runnable.run();
        } else {
            view.post(runnable);
        }
    }
}