|
@ -46,16 +46,11 @@ public class MobileDevice extends Plugin {
|
46
|
46
|
if (requestCode == INIT_NFC) {
|
47
|
47
|
if (resultCode == NfcConstant.SUCCESS_CODE) {
|
48
|
48
|
String nfcMsg = intent.getStringExtra(NfcActivity.NFC_DATA);
|
49
|
|
// StringBuilder buff = new StringBuilder();
|
50
|
|
// buff.append("if(").append(NFC_CALLBACK).append("){");
|
51
|
|
// buff.append("(function(msg){"+NFC_CALLBACK).append("(unescape(").append(EscapeUnescape.escape(nfcMsg)).append("));");
|
52
|
|
// buff.append("}else{alert('请设置获取NFC的回调方法');};");
|
53
|
|
// wademobile.getCurrentWebView().executeJs(buff.toString());
|
54
|
|
|
55
|
|
// 转义
|
56
|
|
String callback = "(function(msg){" + nfcCallback + "(unescape(msg));})";
|
57
|
|
String ret = callback + "('" + EscapeUnescape.escape(nfcMsg) + "')";
|
58
|
|
wademobile.getCurrentWebView().executeJs(ret);
|
|
49
|
StringBuilder buff = new StringBuilder();
|
|
50
|
buff.append("if(window['").append(nfcCallback).append("']){");
|
|
51
|
buff.append(nfcCallback).append("(unescape('").append(EscapeUnescape.escape(nfcMsg)).append("'));");
|
|
52
|
buff.append("}else{alert('请设置获取NFC的回调方法');};");
|
|
53
|
wademobile.getCurrentWebView().executeJs(buff.toString());
|
59
|
54
|
}
|
60
|
55
|
}
|
61
|
56
|
}
|