0

As mentioned here and there an Android Java application may call Javascript functions using the load method from XWalkView class.

But I didn't find how to use this feature in shared mode. (as described here : https://crosswalk-project.org/documentation/getting_started/run_on_android.html#shared-vs-embedded-mode)

Is there a way to retrieve the XWalkView class ?
May Crosswalk's extensions be a solution ?

Edited : in order to better explain this problem a sample project was created : https://github.com/gbourel/SampleCWShared

So the actual issue is how to call Javascript function from the XWalkRuntimeView returned by getRuntimeView() of XWalkRuntimeActivityBase class ?

Community
  • 1
  • 1

2 Answers2

0

Class XWalkView is in the same package with your web resources and additional java code. In Crosswalk Library, there is class XWalkViewInternal communicating with XWalkView.

wang16
  • 1
  • I agree but my first explanation wasn't sufficiently clear : the question is how to access the XWalkView class. I just add a comment to explain this issue. – user2223879 Jan 26 '15 at 10:02
0

The method in runtime view has another name : the XWalkRuntimeView.loadAppFromUrl() method refers actually to the XWalkView.load() method.

Therefor calling loadAppFromUrl('javascript:anyFunction()') works as expected.

Rami
  • 7,879
  • 12
  • 36
  • 66