Example usage for android.preference PreferenceActivity EXTRA_SHOW_FRAGMENT_ARGUMENTS

List of usage examples for android.preference PreferenceActivity EXTRA_SHOW_FRAGMENT_ARGUMENTS

Introduction

In this page you can find the example usage for android.preference PreferenceActivity EXTRA_SHOW_FRAGMENT_ARGUMENTS.

Prototype

String EXTRA_SHOW_FRAGMENT_ARGUMENTS

To view the source code for android.preference PreferenceActivity EXTRA_SHOW_FRAGMENT_ARGUMENTS.

Click Source Link

Document

When starting this activity and using #EXTRA_SHOW_FRAGMENT , this extra can also be specified to supply a Bundle of arguments to pass to that fragment when it is instantiated during the initial creation of PreferenceActivity.

Usage

From source file:be.blinkt.openvpn.activities.VPNPreferences.java

private void getProfile() {
    Intent intent = getIntent();// w w  w.  j  ava 2s.co  m

    if (intent != null) {
        String profileUUID = intent.getStringExtra(getPackageName() + ".profileUUID");
        if (profileUUID == null) {
            Bundle initialArguments = getIntent()
                    .getBundleExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT_ARGUMENTS);
            profileUUID = initialArguments.getString(getPackageName() + ".profileUUID");
        }
        if (profileUUID != null) {

            mProfileUUID = profileUUID;
            mProfile = ProfileManager.get(this, mProfileUUID);

        }
    }
}