Commit a2d680e3 by zhengnw@sobot.com

widget 1.0.6,解决部分手机(oppo)选择不了图片、视频的问题

parent ff56e56c
......@@ -13,7 +13,7 @@ ext {
PUBLISH_GROUP_ID = "com.sobot.library" //项目包名
PUBLISH_ARTIFACT_ID = 'widget' //项目名
// PUBLISH_ARTIFACT_ID = 'widget_x' //项目名
PUBLISH_VERSION = '1.0.5' //版本号
PUBLISH_VERSION = '1.0.6' //版本号
}
......
......@@ -55,9 +55,20 @@ public class SobotWidgetUtils {
act.startActivityForResult(intent, SobotBaseConstant.REQUEST_CODE_PICTURE);
}
} catch (Exception e) {
intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
try {
if (childFragment != null) {
childFragment.startActivityForResult(intent, SobotBaseConstant.REQUEST_CODE_PICTURE);
} else {
act.startActivityForResult(intent, SobotBaseConstant.REQUEST_CODE_PICTURE);
}
} catch (Exception exception) {
exception.printStackTrace();
SobotToastUtil.showToast(act.getApplicationContext(), SobotResourceUtils.getResString(act, "sobot_not_open_album"));
}
}
}
/**
* activity打开选择视频界面
......@@ -92,10 +103,20 @@ public class SobotWidgetUtils {
act.startActivityForResult(intent, SobotBaseConstant.REQUEST_CODE_VIDEO);
}
} catch (Exception e) {
e.printStackTrace();
intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("video/*");
try {
if (childFragment != null) {
childFragment.startActivityForResult(intent, SobotBaseConstant.REQUEST_CODE_VIDEO);
} else {
act.startActivityForResult(intent, SobotBaseConstant.REQUEST_CODE_VIDEO);
}
} catch (Exception exception) {
exception.printStackTrace();
SobotToastUtil.showToast(act.getApplicationContext(), SobotResourceUtils.getResString(act, "sobot_not_open_album"));
}
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment