本文整理匯總了Java中android.preference.PreferenceFragment類的典型用法代碼示例。如果您正苦於以下問題:Java PreferenceFragment類的具體用法?Java PreferenceFragment怎麽用?Java PreferenceFragment使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PreferenceFragment類屬於android.preference包,在下文中一共展示了PreferenceFragment類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import android.preference.PreferenceFragment; //導入依賴的package包/類
public static void init(final XSharedPreferences prefs, final ClassLoader classLoader) {
try {
final Class<?> classDevSettings = XposedHelpers.findClass(CLASS_DEV_SETTINGS, classLoader);
if (DEBUG) log("hooking DeveloperSettings.onCreate method");
XposedHelpers.findAndHookMethod(classDevSettings, "onCreate", Bundle.class, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(final MethodHookParam param) throws Throwable {
PreferenceFragment pf = (PreferenceFragment) param.thisObject;
mResId = pf.getResources().getIdentifier("development_prefs", "xml", PACKAGE_NAME);
if (DEBUG) log("mResId=" + mResId);
}
});
}
catch (Throwable t) {
XposedBridge.log(t);
}
}
示例2: showFragment
import android.preference.PreferenceFragment; //導入依賴的package包/類
protected void showFragment(String tag, boolean addToBackStack) {
PreferenceFragment fragment = (PreferenceFragment) getFragmentManager().findFragmentByTag(tag);
if (fragment == null) {
switch (tag) {
case SettingsFragmentMaster.TAG:
default:
fragment = new SettingsFragmentMaster();
toolbar.setTitle(R.string.settings);
break;
}
}
FragmentTransaction t = getFragmentManager().beginTransaction();
if (addToBackStack) {
t.addToBackStack(tag);
}
t.replace(R.id.settings__fragment_container, fragment, tag).commit();
}
示例3: onCreate
import android.preference.PreferenceFragment; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
PreferenceFragment fragment = new MyPreferenceFragment();
getFragmentManager().beginTransaction().replace(android.R.id.content, fragment).commit();
getFragmentManager().executePendingTransactions();
fragment.getPreferenceScreen().findPreference("a").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Intent intent = new Intent(Preferences.this, IconPicker.class);
startActivityForResult(intent, REQUEST_CODE);
return true;
}
});
}
示例4: isValidFragment
import android.preference.PreferenceFragment; //導入依賴的package包/類
/**
* This method stops fragment injection in malicious applications.
* Make sure to deny any unknown fragments here.
*/
protected boolean isValidFragment(String fragmentName) {
return PreferenceFragment.class.getName().equals(fragmentName)
|| GeneralPreferenceFragment.class.getName().equals(fragmentName)
|| LocationPreferenceFragment.class.getName().equals(fragmentName)
|| SyncPreferenceFragment.class.getName().equals(fragmentName);
}
示例5: isValidFragment
import android.preference.PreferenceFragment; //導入依賴的package包/類
/**
* This method stops fragment injection in malicious applications.
* Make sure to deny any unknown fragments here.
*/
protected boolean isValidFragment(String fragmentName) {
return PreferenceFragment.class.getName().equals(fragmentName)
|| GeneralPreferenceFragment.class.getName().equals(fragmentName)
|| PasswordPreferenceFragment.class.getName().equals(fragmentName)
|| DateOfBirthPreferenceFragment.class.getName().equals(fragmentName);
}
示例6: isValidFragment
import android.preference.PreferenceFragment; //導入依賴的package包/類
/**
* This method stops fragment injection in malicious applications.
* Make sure to deny any unknown fragments here.
*/
protected boolean isValidFragment(String fragmentName) {
return PreferenceFragment.class.getName().equals(fragmentName)
|| GeneralPreferenceFragment.class.getName().equals(fragmentName)
|| DataSyncPreferenceFragment.class.getName().equals(fragmentName)
|| NotificationPreferenceFragment.class.getName().equals(fragmentName);
}
示例7: isValidFragment
import android.preference.PreferenceFragment; //導入依賴的package包/類
/**
* This method stops fragment injection in malicious applications.
* Make sure to deny any unknown fragments here.
*/
protected boolean isValidFragment(String fragmentName) {
return PreferenceFragment.class.getName().equals(fragmentName)
|| GeneralPreferenceFragment.class.getName().equals(fragmentName)
|| DataSyncPreferenceFragment.class.getName().equals(fragmentName)
|| NotificationPreferenceFragment.class.getName().equals(fragmentName);
}
示例8: isValidFragment
import android.preference.PreferenceFragment; //導入依賴的package包/類
/**
* This method stops fragment injection in malicious applications.
* Make sure to deny any unknown fragments here.
*/
protected boolean isValidFragment(String fragmentName) {
return PreferenceFragment.class.getName ().equals (fragmentName)
|| GeneralPreferenceFragment.class.getName ().equals (fragmentName)
|| DataSyncPreferenceFragment.class.getName ().equals (fragmentName)
|| NotificationPreferenceFragment.class.getName ().equals (fragmentName);
}
示例9: isValidFragment
import android.preference.PreferenceFragment; //導入依賴的package包/類
/**
* This method stops fragment injection in malicious applications.
* Make sure to deny any unknown fragments here.
*/
protected boolean isValidFragment(String fragmentName) {
return PreferenceFragment.class.getName().equals(fragmentName)
|| GeneralPreferenceFragment.class.getName().equals(fragmentName)
|| DataSyncPreferenceFragment.class.getName().equals(fragmentName)
|| NotificationPreferenceFragment.class.getName().equals(fragmentName)
|| NamePreferenceFragment.class.getName().equals(fragmentName);
}
示例10: isValidFragment
import android.preference.PreferenceFragment; //導入依賴的package包/類
protected boolean isValidFragment(String fragmentName) {
return PreferenceFragment.class.getName().equals(fragmentName)
|| SipPreferenceFragment.class.getName().equals(fragmentName)
|| VideoPreferenceFragment.class.getName().equals(fragmentName)
|| AudioPreferenceFragment.class.getName().equals(fragmentName)
|| CommandsPreferenceFragment.class.getName().equals(fragmentName)
|| NotificationsPreferenceFragment.class.getName().equals(fragmentName)
|| AdvancedPreferenceFragment.class.getName().equals(fragmentName)
|| EchoCancellationPreferenceFragment.class.getName().equals(fragmentName)
|| SipAccountPreferenceFragment.class.getName().equals(fragmentName);
}
示例11: isValidFragment
import android.preference.PreferenceFragment; //導入依賴的package包/類
/**
* This method stops fragment injection in malicious applications.
* Make sure to deny any unknown fragments here.
*/
protected boolean isValidFragment(String fragmentName) {
return PreferenceFragment.class.getName().equals(fragmentName)
|| MqttPreferenceFragment.class.getName().equals(fragmentName)
|| BeaconPreferenceFragment.class.getName().equals(fragmentName)
|| GeneralPreferenceFragment.class.getName().equals(fragmentName);
}
示例12: isValidFragment
import android.preference.PreferenceFragment; //導入依賴的package包/類
/**
* This method stops fragment injection in malicious applications.
* Make sure to deny any unknown fragments here.
*/
protected boolean isValidFragment(String fragmentName) {
return PreferenceFragment.class.getName().equals(fragmentName)
|| GeneralPreferenceFragment.class.getName().equals(fragmentName)
|| BacklightPreferenceFragment.class.getName().equals(fragmentName)
|| BluetoothPreferenceFragment.class.getName().equals(fragmentName)
|| DebugPreferenceFragment.class.getName().equals(fragmentName)
|| AboutFragment.class.getName().equals(fragmentName);
}
示例13: isValidFragment
import android.preference.PreferenceFragment; //導入依賴的package包/類
/**
* This method stops fragment injection in malicious applications.
* Make sure to deny any unknown fragments here.
*/
protected boolean isValidFragment(@NonNull String fragmentName) {
return PreferenceFragment.class.getName().equals(fragmentName)
|| UserPreferenceFragment.class.getName().equals(fragmentName)
|| NetworkPreferenceFragment.class.getName().equals(fragmentName)
|| NotificationPreferenceFragment.class.getName().equals(fragmentName)
|| ReloadPreferenceFragment.class.getName().equals(fragmentName)
|| OpenWeatherPreferenceFragment.class.getName().equals(fragmentName)
|| WirelessSocketPreferenceFragment.class.getName().equals(fragmentName)
|| CoinPreferenceFragment.class.getName().equals(fragmentName)
|| WirelessSwitchPreferenceFragment.class.getName().equals(fragmentName)
|| PositionPreferenceFragment.class.getName().equals(fragmentName);
}
示例14: isValidFragment
import android.preference.PreferenceFragment; //導入依賴的package包/類
/**
* This method stops fragment injection in malicious applications.
* Make sure to deny any unknown fragments here.
*/
protected boolean isValidFragment(String fragmentName) {
return PreferenceFragment.class.getName().equals(fragmentName)
|| ExperimentalPreferenceFragment.class.getName().equals(fragmentName)
|| DataSyncPreferenceFragment.class.getName().equals(fragmentName)
|| NotificationPreferenceFragment.class.getName().equals(fragmentName)
|| VersionPreferenceFragment.class.getName().equals(fragmentName);
}
示例15: isValidFragment
import android.preference.PreferenceFragment; //導入依賴的package包/類
/**
* This method stops fragment injection in malicious applications.
* Make sure to deny any unknown fragments here.
*/
protected boolean isValidFragment(String fragmentName) {
return PreferenceFragment.class.getName().equals(fragmentName)
|| GeneralPreferenceFragment.class.getName().equals(fragmentName)
//|| DataSyncPreferenceFragment.class.getName().equals(fragmentName)
|| NotificationPreferenceFragment.class.getName().equals(fragmentName);
}