Skip to content

Instantly share code, notes, and snippets.

@meeDamian
Created December 21, 2013 23:43
Show Gist options
  • Save meeDamian/8076737 to your computer and use it in GitHub Desktop.
Save meeDamian/8076737 to your computer and use it in GitHub Desktop.
protected boolean isValidFragment(String fragmentName) {
if (getApplicationInfo().targetSdkVersion >= android.os.Build.VERSION_CODES.KITKAT) {
throw new RuntimeException(
"Subclasses of PreferenceActivity must override isValidFragment(String)"
+ " to verify that the Fragment class is valid! " + this.getClass().getName()
+ " has not checked if fragment " + fragmentName + " is valid.");
} else {
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment