Re: [PhoneGap] Echo Plugin Docs Error?

12 views
Skip to first unread message

Shazron

unread,
Jan 29, 2013, 7:28:24 PM1/29/13
to phonegap


On Sun, Jan 27, 2013 at 11:44 AM, Gerald Skerbitz <gske...@gmail.com> wrote:
I'm just getting started with android and cordova. I tried to implement the Echo Plugin from

guide_plugin-development_android_index.md

I needed to add another parameter to the call in Echo.java to get it to work.

This is the code from the docs:
public class Echo extends CordovaPlugin {
   
@Override
   
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
       
if (action.equals("echo")) {
           
String message = args.getString(0);
           
this.echo(message);
           
return true;
       
}
       
return false;
   
}
}

I had to make it this.echo(message,callbackContext) in order for it to work.



--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
 
 

Reply all
Reply to author
Forward
0 new messages