Skip to content

Instantly share code, notes, and snippets.

@noln
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noln/1c5b595fbc2f83072a98 to your computer and use it in GitHub Desktop.
Save noln/1c5b595fbc2f83072a98 to your computer and use it in GitHub Desktop.
Using this instead of straight Spoon.screenshot(..) until issue identified in https://github.com/square/spoon/issues/151 is resolved. Extremely noddy for a Gist, but works with my library-builder script (which I might open source when it's done :-P).
private void failoverScreenshot(String desc) {
try {
Spoon.screenshot(getActivity(), desc);
}
catch (IllegalArgumentException e) {
Log.v(TAG, "Handled erroneous Spoon-Client screenshot exception.");
}
catch (OutOfMemoryError e) {
Log.v(TAG, "Couldn't take screenshot: OOM on device");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment