mirror of
https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin.git
synced 2026-04-28 00:00:04 +08:00
#20 Click event, now with an optional data object
This commit is contained in:
@@ -55,6 +55,7 @@ public class Toast extends CordovaPlugin {
|
||||
final String duration = options.getString("duration");
|
||||
final String position = options.getString("position");
|
||||
final int addPixelsY = options.has("addPixelsY") ? options.getInt("addPixelsY") : 0;
|
||||
final JSONObject data = options.has("data") ? options.getJSONObject("data") : null;
|
||||
|
||||
cordova.getActivity().runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -88,6 +89,7 @@ public class Toast extends CordovaPlugin {
|
||||
try {
|
||||
json.put("event", "touch");
|
||||
json.put("message", message);
|
||||
json.put("data", data);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user