FileDocCategorySizeDatePackage
RunQueue.javaAPI DocAndroid 5.1 API2140Thu Mar 12 22:22:12 GMT 2015android.view

RunQueue

public class RunQueue extends android.app.Activity implements ViewTreeObserver.OnGlobalLayoutListener
Tests views using post*() and getViewTreeObserver() before onAttachedToWindow().

Fields Summary
public boolean
runnableRan
public boolean
runnableCancelled
public boolean
globalLayout
public android.view.ViewTreeObserver
viewTreeObserver
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle icicle)


    
        
        super.onCreate(icicle);

        TextView textView = new TextView(this);
        textView.setText("RunQueue");
        textView.setId(R.id.simple_view);

        setContentView(textView);
        final View view = findViewById(R.id.simple_view);

        view.post(new Runnable() {
            public void run() {
                runnableRan = true;
            }
        });

        final Runnable runnable = new Runnable() {
            public void run() {
                runnableCancelled = false;
            }
        };
        view.post(runnable);
        view.post(runnable);
        view.post(runnable);
        view.post(runnable);
        view.removeCallbacks(runnable);

        viewTreeObserver = view.getViewTreeObserver();
        viewTreeObserver.addOnGlobalLayoutListener(this);
    
public voidonGlobalLayout()

        globalLayout = true;