FileDocCategorySizeDatePackage
Forwarding.javaAPI DocGoogle Android v1.5 Example2847Sun Nov 11 13:01:04 GMT 2007com.google.android.samples.app

Forwarding

public class Forwarding extends android.app.Activity

Example of removing yourself from the history stack after forwarding to another activity. This can be useful, for example, to implement a confirmation dialog before the user goes on to another activity -- once the user has confirmed this operation, they should not see the dialog again if they go back from it.

Note that another way to implement a confirmation dialog would be as an activity that returns a result to its caller. Either approach can be useful depending on how it makes sense to structure the application.

Demo

App/Activity/Receive Result

Source files

src/com/google/android/samples/app/Forwarding.java Forwards the user to another activity when its button is pressed
/res/any/layout/forwarding.xml Defines contents of the Forwarding screen

Fields Summary
private android.view.View.OnClickListener
mGoListener
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle icicle)

        super.onCreate(icicle);

        setContentView(R.layout.forwarding);

        // Watch for button clicks.
        Button goButton = (Button)findViewById(R.id.go);
        goButton.setOnClickListener(mGoListener);