本文整理汇总了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);
}