Hi, Matthew
Thanks for your question. You can get the activity through class
'XWalkExtensionContextClient' which has a public method called 'getActivity()'.
Thus you can get all Android views you want.
public class MyExtension extends XWalkExtensionClient {
final private XWalkExtensionContextClient mExtensionContext;
// Don't change the parameters in Constructor because XWalk needs to call
this constructor.
public MyExtension(String name, String JsApiContent,
XWalkExtensionContextClient context) {
super(name, JsApiContent, context);
mExtensionContext = context;
}
Once you get activity object, it's easy to get/modify its content view. But
please be careful that extensions are running on a different thread other than
UI thread. So it's not thread safe to do this kind of changes.
Yongsheng
From: Crosswalk-help
[mailto:[email protected]] On Behalf Of
Matthew Sun
Sent: Friday, February 07, 2014 8:27 PM
To: [email protected]
Subject: [Crosswalk-help] (no subject)
Hi
I was wondering if you know how to get a handle on the main FrameLayout from an
extension? In the AppTemplateActivity.java I know it can be done with
getRuntimeView().get(). Do you know a simple way to do it from an extension?
This would allow us to modify the main view from the extension. Or even better
is there a way to get a handle on the main class itself (the one that extends
XWalkRuntimeActivityBase in the file AppTemplateActivity.java)
Regards
Matthew
_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help