FileDocCategorySizeDatePackage
RedirectGetter.javaAPI DocAndroid 1.5 API2575Wed May 06 22:41:08 BST 2009com.example.android.apis.app

RedirectGetter

public class RedirectGetter extends android.app.Activity
Sub-activity that is executed by the redirection example when input is needed from the user.

Fields Summary
private android.view.View.OnClickListener
mApplyListener
private String
mTextPref
android.widget.TextView
mText
Constructors Summary
Methods Summary
private final booleanloadPrefs()

        // Retrieve the current redirect values.
        // NOTE: because this preference is shared between multiple
        // activities, you must be careful about when you read or write
        // it in order to keep from stepping on yourself.
        SharedPreferences preferences = getSharedPreferences("RedirectData", 0);

        mTextPref = preferences.getString("text", null);
        if (mTextPref != null) {
            mText.setText(mTextPref);
            return true;
        }

        return false;
    
protected voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);

        setContentView(R.layout.redirect_getter);

        // Watch for button clicks.
        Button applyButton = (Button)findViewById(R.id.apply);
        applyButton.setOnClickListener(mApplyListener);

        // The text being set.
        mText = (TextView)findViewById(R.id.text);