Last active
February 12, 2018 07:08
-
-
Save tankery/b237a6a99ea3e00db98a5b7e32d9cc68 to your computer and use it in GitHub Desktop.
Show Android Build fields
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
for (Field field : Build.class.getFields()) { | |
try { | |
if (field.getType().isAssignableFrom(String.class)) { | |
Timber.d("%16s: %s", field.getName(), field.get(null)); | |
} | |
} catch (IllegalAccessException e) { | |
Timber.w(e, "Failed to print %s", field.getName()); | |
} | |
} | |
for (Field field : Build.VERSION.class.getFields()) { | |
try { | |
if (field.getType().isAssignableFrom(String.class)) { | |
Timber.d("%16s: %s", field.getName(), field.get(null)); | |
} | |
} catch (IllegalAccessException e) { | |
Timber.w(e, "Failed to print %s", field.getName()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment