android.preference.DialogPreference Java Examples

The following examples show how to use android.preference.DialogPreference. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BasePreferenceFragment.java    From Dashchan with Apache License 2.0 6 votes vote down vote up
protected void expandDialog(Preference preference) {
	if (preference instanceof DialogPreference) {
		try {
			if (preference.getPreferenceManager() == null) {
				Method onAttachedToHierarchy = Preference.class.getDeclaredMethod("onAttachedToHierarchy",
						PreferenceManager.class);
				onAttachedToHierarchy.setAccessible(true);
				onAttachedToHierarchy.invoke(preference, getPreferenceManager());
			}
			Method onClickMethod = Preference.class.getDeclaredMethod("onClick");
			onClickMethod.setAccessible(true);
			onClickMethod.invoke(preference);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}
 
Example #2
Source File: DialogPreferenceAssert.java    From assertj-android with Apache License 2.0 4 votes vote down vote up
public DialogPreferenceAssert(DialogPreference actual) {
  super(actual, DialogPreferenceAssert.class);
}