Re: [android-developers] How to communicate from Javascript back to an app?
On Wed, May 12, 2010 at 11:54 AM, Mark Murphy <mmurphy@commonsware.com> wrote:
>> But what's the right way to get data from Javascript back to the
>> application? It's simple to have javascript call app methods, but any
>> parameters specified in the call on the javascript side don't survive
>> the trip (I just get null in the app).
>
> It worked for me, if you choose primitive data values. I don't have any
> examples handy, as the last time I did that was for a consulting gig.
You're right, but it looks like it cares about how you declare the
method. If it looks like this:
public void callThisJavaMethod(Object x) { ...
I get null. If it looks like this:
public void callThisJavaMethod(String x) { ...
I can get a string. I'll just turn everything I care about into json,
works well enough.
--
James Moore
james@restphone.com
http://jamesmoorecode.blogspot.com/
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home