修复 一些崩溃问题

This commit is contained in:
hyb1996
2018-11-20 23:43:19 +08:00
parent 3835c9d4a9
commit 955433ae00
6 changed files with 23 additions and 9 deletions

View File

@@ -70,7 +70,12 @@ public class ScreenCapturer {
int orientation = mContext.getResources().getConfiguration().orientation;
if (mOrientation == ORIENTATION_AUTO && mDetectedOrientation != orientation) {
mDetectedOrientation = orientation;
refreshVirtualDisplay(orientation);
try {
refreshVirtualDisplay(orientation);
}catch (Exception e){
e.printStackTrace();
mException = e;
}
}
}
@@ -148,8 +153,8 @@ public class ScreenCapturer {
@Nullable
public Image capture() {
if (mException != null) {
Exception e = mException;
Exception e = mException;
if (e != null) {
mException = null;
throw new ScriptException(e);
}