FileDocCategorySizeDatePackage
RunQueue.javaAPI DocAndroid 1.5 API2151Wed May 06 22:42:02 BST 2009com.android.frameworktest.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;