FileDocCategorySizeDatePackage
TestedScreen.javaAPI DocAndroid 1.5 API5090Wed May 06 22:42:02 BST 2009com.android.unit_tests.activity

TestedScreen

public class TestedScreen extends android.app.Activity

Fields Summary
public static final String
WAIT_BEFORE_FINISH
public static final String
DELIVER_RESULT
public static final String
CLEAR_TASK
private android.os.Handler
mHandler
Constructors Summary
public TestedScreen()

    
      
    
Methods Summary
private voidlaunchClearTask()

        Intent intent = new Intent(getIntent()).
        addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP).
        setClass(this, ClearTop.class);
        startActivity(intent);
    
public voidonCreate(android.os.Bundle icicle)

        super.onCreate(icicle);
        if (ActivityTests.DEBUG_LIFECYCLE) Log.v("test", "CREATE tested "
                + Integer.toHexString(System.identityHashCode(this)) + ": " + getIntent());
        if (LaunchpadActivity.FORWARD_RESULT.equals(getIntent().getAction())) {
            Intent intent = new Intent(getIntent());
            intent.setAction(DELIVER_RESULT);
            intent.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
            startActivity(intent);
            if (ActivityTests.DEBUG_LIFECYCLE) Log.v("test", "Finishing tested "
                    + Integer.toHexString(System.identityHashCode(this)) + ": " + getIntent());
            finish();
        } else if (DELIVER_RESULT.equals(getIntent().getAction())) {
            setResult(RESULT_OK, (new Intent()).setAction(
                    LaunchpadActivity.RETURNED_RESULT));
            if (ActivityTests.DEBUG_LIFECYCLE) Log.v("test", "Finishing tested "
                    + Integer.toHexString(System.identityHashCode(this)) + ": " + getIntent());
            finish();
        } else if (CLEAR_TASK.equals(getIntent().getAction())) {
            if (!getIntent().getBooleanExtra(ClearTop.WAIT_CLEAR_TASK, false)) {
                launchClearTask();
            }
        }
    
protected voidonRestoreInstanceState(android.os.Bundle state)

        super.onRestoreInstanceState(state);
    
protected voidonResume()

        super.onResume();
        if (ActivityTests.DEBUG_LIFECYCLE) Log.v("test", "RESUME tested "
                + Integer.toHexString(System.identityHashCode(this)) + ": " + getIntent());
        if (CLEAR_TASK.equals(getIntent().getAction())) {
            if (getIntent().getBooleanExtra(ClearTop.WAIT_CLEAR_TASK, false)) {
                Looper.myLooper().myQueue().addIdleHandler(new Idler());
            }
        } else {
            Looper.myLooper().myQueue().addIdleHandler(new Idler());
        }
    
protected voidonSaveInstanceState(android.os.Bundle outState)

        super.onSaveInstanceState(outState);
    
protected voidonStop()

        super.onStop();
        if (ActivityTests.DEBUG_LIFECYCLE) Log.v("test", "STOP tested "
                + Integer.toHexString(System.identityHashCode(this)) + ": " + getIntent());