如何創建取消和PhoneGap的OK按鈕使用PhoneGap.exec(null, null, "Notification", "activityStart", ["Downloading file","Please wait..."]);
如何在phonegap .exec提醒框中創建Phonegap取消按鈕?
1
A
回答
0
請註明您要申請的PhoneGap插件(IOS,安卓)以下 界河技術是代碼,這將幫助您創建的Android核心alertbox 通話這個功能上執行方法
public synchronized void customalertBox(final String callBackId, JSONArray jarray) {
final AlertDialog showCustomDialog = null;
final Runnable runnable = new Runnable() {
@Override
public void run() {
AlertDialog.Builder customdialog = new AlertDialog.Builder(null);
showCustomDialog.setButton2("OK", new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
customalertPLUGIN.success(new PluginResult(
PluginResult.Status.OK, setJSONDataTORETURN),
callBackId);
showCustomDialog.dismiss();
}
});
showCustomDialog.setButton2("Cancel", new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
customalertPLUGIN
.error(new PluginResult(
PluginResult.Status.INVALID_ACTION),
callBackId);
showCustomDialog.dismiss();
}
});
showCustomDialog = customdialog.create();
showCustomDialog.setCancelable(true);
showCustomDialog.show();
}
};
}
希望的部份將有助於you.leave評論
1
navigator.notification.confirm(
'Do you want to signout and close the application?', // message
onConfirm, // callback to invoke with index of button pressed
'Sign Out', // title
'Sign Out,Cancel' // buttonLabels
);
和
function onConfirm(button) {
//action for confirmation
}
參考 http://docs.phonegap.com/en/1.2.0/phonegap_notification_notification.md.html
是的,我需要爲Android – Raj 2012-04-14 03:54:18
JST嘗試的部份次讓我KNW反饋... – user1140237 2012-04-16 07:00:53