Last active
November 18, 2020 19:51
-
-
Save cribetti/87d1b0a09a33dabb39cc699563024d67 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@NonNull | |
public static Fragment instantiate(@NonNull Context context, @NonNull String fname, @Nullable Bundle args) { | |
try { | |
... | |
Fragment f = clazz.getConstructor().newInstance(); | |
if (args != null) { | |
args.setClassLoader(...); | |
f.setArguments(args); | |
} | |
return f; | |
} catch (java.lang.InstantiationException e) { | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment