gecko/mobile/android/base/preferences/LinkPreference.java
Lucas Rocha 36fbc91acb Bug 936522 - Move preference-related to the preferences package (r=liuche)
--HG--
rename : mobile/android/base/AlignRightLinkPreference.java => mobile/android/base/preferences/AlignRightLinkPreference.java
rename : mobile/android/base/AndroidImport.java => mobile/android/base/preferences/AndroidImport.java
rename : mobile/android/base/AndroidImportPreference.java => mobile/android/base/preferences/AndroidImportPreference.java
rename : mobile/android/base/FontSizePreference.java => mobile/android/base/preferences/FontSizePreference.java
rename : mobile/android/base/GeckoPreferenceFragment.java => mobile/android/base/preferences/GeckoPreferenceFragment.java
rename : mobile/android/base/GeckoPreferences.java => mobile/android/base/preferences/GeckoPreferences.java
rename : mobile/android/base/LinkPreference.java => mobile/android/base/preferences/LinkPreference.java
rename : mobile/android/base/MultiChoicePreference.java => mobile/android/base/preferences/MultiChoicePreference.java
rename : mobile/android/base/PrivateDataPreference.java => mobile/android/base/preferences/PrivateDataPreference.java
rename : mobile/android/base/SyncPreference.java => mobile/android/base/preferences/SyncPreference.java
2013-11-11 18:41:16 +00:00

32 lines
1006 B
Java

/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.preferences;
import org.mozilla.gecko.Tabs;
import android.content.Context;
import android.preference.Preference;
import android.util.AttributeSet;
class LinkPreference extends Preference {
private String mUrl = null;
public LinkPreference(Context context, AttributeSet attrs) {
super(context, attrs);
mUrl = attrs.getAttributeValue(null, "url");
}
public LinkPreference(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mUrl = attrs.getAttributeValue(null, "url");
}
@Override
protected void onClick() {
Tabs.getInstance().loadUrlInTab(mUrl);
callChangeListener(mUrl);
}
}