screenshots should be taken on ui thread

This commit is contained in:
Antonio Zugaldia
2015-09-16 11:17:42 -04:00
parent f775348ec3
commit ed33a5ee64

View File

@@ -31,8 +31,16 @@ public class BaseTest {
* Screenshots logic
*/
protected void takeNamedScreenshot(Activity activity, String name) {
ScreenshotUtil.take(activity, name);
protected void takeNamedScreenshot(final Activity activity, final String name) {
// Screenshots need to be taken on the UI thread
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
ScreenshotUtil.take(activity, name);
}
});
}
}