On Jan 5, 2012, at 4:50 AM, Tomasz Cielecki wrote:
> I am trying to add a javascript interface to my webview but it the method in
> the object I pass to the webview does not get triggered.
...
> I was thinking whether it is possible to tell mandroid to put the methods in
> the generated Java files, so that Java knows of them.
Yes, though as you saw it breaks because the Android Callable Wrapper use
@Override, which breaks you.
The solution [0] is a level of indirection: declare a Java-side interface, then
bind that interface in C# and implement it. You'll still need to write some
Java code, but only the interface declaration.
Unfortunately, binding interfaces is more complicated. Fortunately, I have a
sample:
https://github.com/xamarin/monodroid-samples/blob/master/SanityTests/Adder.java
https://github.com/xamarin/monodroid-samples/blob/master/SanityTests/ManagedAdder.cs
I also have docs, but those are awaiting review.
- Jon
[0] Yes, this isn't a very good solution. We'll be working on improving this in
future releases.
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid