如何使用phonegap从另一个开始一个活动?
答
为按钮添加单击事件:在WebView中
<button type="button" onclick="your_button.performClick();">Your Button</button>
设置单击事件:
WebSettings ws = wv.getSettings();
ws.setJavaScriptEnabled(true);
wv.addJavascriptInterface(new Object() {
public void performClick() {
// Your can start Activity here
Intent intent = new Intent();
// set Activity which you want to start
// Set flags, actions and other parameters if required
this.cordova.startActivity(intent);
}
}, "your_button");