Hello,

are you aware, that you only need to extend XWalkApplication and XWalkActivity, if you want to use Crosswalk in shared mode? You could just embed the full library as described here: https://crosswalk-project.org/documentation/embedding_crosswalk/crosswalk_aar.html

I am also pretty sure that you do not need to extend RoboApplication, if you are using RoboGuice 2.0+. You only have to get the Injector using RoboGuice.setBaseApplicationInjector and inject the members using Injector.injectMembers in your Application's onCreate method, if nessesary.

And for the Activity you could write your own XWalkRoboActivity. Simply copy the source of roboguice.activity.RoboActivity to your own implementation which extends XWalkActivity (or reverse).

Regards,
Julian

On 7/27/2015 10:43 AM, Haris Zaman wrote:
Hi,

I have an android application that already extends from Roboguice library, but in the Crosswalk docs and sample app it is said that Application should extends from XWalkApplication to overcome this problem I did change like following

public class MyApplication extends RoboguiceInjectableApplication{
  private XWalkApplication xwalkApp=new XWalkApplication();
   @Override
   public void onCreate(){
     super.onCreate();
     xwalkApp.onCreate()
   }

}

and then In my activity to avoid the same problem that MyActivity already extends from some activity but the docs are saying to extend from XwalkActivity, I am doing like this to avoid it

public class MyActivity extends RoboActivity{

 private XWalkActivity xwalkactivity=new XWalkActivity() {
    @Override
    protected void onXWalkReady() {
      // TODO Auto-generated method stub
      Log.d(TAG, "xwalk ready");
      xwalkview=(XWalkView)findViewById(R.id.webview_test);
      xwalkview.load("http://www.google.com";, null);
    }

};

    @Overrride
    public onCreate(Bundle saveInstance){
        super.onCreate();
        xwalkActivity.onCreate();
    }
}

But I am getting exception while launching MyActivity. Any help would be appreciated.

BR,
Haris



_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help

_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help

Reply via email to