FileDocCategorySizeDatePackage
RedirectGetter.javaAPI DocGoogle Android v1.5 Example2536Sun Nov 11 13:01:04 GMT 2007com.google.android.samples.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 icicle)

        super.onCreate(icicle);

        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);