It was able to display a prompt box in common resources ("preview as common resources"), but it is not working in the Android Emualtor.
What is the reason?
It was able to display a prompt box in common resources ("preview as common resources"), but it is not working in the Android Emualtor.
What is the reason?
Have you tried using Cordova's navigator.prompt?
For example, in common\main.js:
function wlCommonInit() {
navigator.notification.prompt(
'Please enter your name', // message
onPrompt, // callback to invoke
'Registration', // title
['Ok','Exit'], // buttonLabels
'Jane Doe' // defaultText
);
}
function onPrompt() {
alert("prompted");
}
I tested this in iOS, but it will work in Android as well.
When previewing your application, use some stub or "regular" JS implementation, but for the mobile environments, use Cordova's.