Example usage for android.preference Preference getIntent

List of usage examples for android.preference Preference getIntent

Introduction

In this page you can find the example usage for android.preference Preference getIntent.

Prototype

public Intent getIntent() 

Source Link

Document

Return the Intent associated with this Preference.

Usage

From source file:com.door43.translationstudio.SettingsActivity.java

/**
 * Intercepts clicks and passes the resource to the intent.
 * The preference should be configured as an action to an intent for the LegalDocumentActivity
 * @param preference/*from  w w w  . ja v a 2s.c om*/
 * @param res
 */
public static void bindPreferenceClickToLegalDocument(Preference preference, final int res) {
    preference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
        @Override
        public boolean onPreferenceClick(Preference preference) {
            Intent intent = preference.getIntent();
            intent.putExtra(LegalDocumentActivity.ARG_RESOURCE, res);
            preference.setIntent(intent);
            return false;
        }
    });
}