Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cribetti/444999970425d0fe84ba5d5cb9097f98 to your computer and use it in GitHub Desktop.
Save cribetti/444999970425d0fe84ba5d5cb9097f98 to your computer and use it in GitHub Desktop.
@NonNull
public Fragment instantiate(@NonNull ClassLoader classLoader, @NonNull String className) {
try {
...
return cls.getConstructor().newInstance();
} catch (java.lang.InstantiationException e) {
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment