Keith
unread,Apr 8, 2011, 12:46:13 AM4/8/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to phonegap
FWIW here's what I've got working.
A simple TimePicker class with a showTimePicker method.
public class TimePicker {
private DroidGap mGap;
public TimePicker(DroidGap gap)
{
mGap = gap;
}
public void showTimePicker(){
mGap.showDialog(HelloWorldPlugin.TIME_DIALOG_ID);
}
}
A custom TimePickerDialog.OnTimeSetListener which is initialized with
knowledge of DroidGap too...
@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
mGap.sendJavascript(" callback javascript goes here!");
}
Initialize and add the createdialog stuff like the android dialog
tutorial.
TimePicker timepicker = new TimePicker(this, appView);
appView.addJavascriptInterface(timepicker, "TimePicker");
Then in the javascript, once phonegap loads, you can refer to the
timepicker:
window.TimePicker.showTimePicker();
Hope that Saves Somebody else some time or inspires somebody to show
me the ways of the plugin framework.