0

I have a doubt. What happens is the following: I exported my game by using cocoonjs contruct 2, but I want to run it on my android webview by, because I want to implement starApp, and cocoonjs not support this. So, using my code below, I get only a blank screen. But in my launcher cocoonjs, this same project works normally, just that I select Canvas + can anyone help me?

web = (WebView) findViewById(R.id.webInicial); 
web.setWebChromeClient(new WebChromeClient()); 
web.getSettings().setJavaScriptEnabled(true); 
web.loadUrl("file:///android_asset/www/index.html");
Mina Fawzy
  • 20,852
  • 17
  • 133
  • 156

2 Answers2

0
webView.loadData(yourData, "text/html", "UTF-8");

Where youData is the actual HTML data.

amalBit
  • 12,041
  • 6
  • 77
  • 94
0

Have you tried getApplicationContext().getAssets().open("www/index.html");?

If that doesn't work, I'd say try the solutions in this post and let us know if it worked for you.

Community
  • 1
  • 1
CodyEngel
  • 1,501
  • 14
  • 22