in feedback_android_demo/src/main/java/com/alibaba/openim/feedbackdemo/DemoLoginActivity.java [84:112]
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if (result != null) {
if (result.getContents() == null) {
Log.e(TAG, "scan getContents is null");
} else {
String url = result.getContents();
Log.d(TAG, "scan getContents: " + url);
String pattern = "^(https?)";
Pattern regex = Pattern.compile(pattern);
Matcher m = regex.matcher(url);
if (m.find()) {
String protocol = m.group(1);
FeedbackAPI.setWebViewUrl(url.replace(protocol, "https"));
} else {
FeedbackAPI.setWebViewUrl(url);
}
handler.postDelayed(new Runnable() {
@Override
public void run() {
FeedbackAPI.openFeedbackActivity();
}
}, 500);
}
} else {
// This is important, otherwise the result will not be passed to the fragment
super.onActivityResult(requestCode, resultCode, data);
}
}