0

i want to show webview in my game.i found a example here.it works fine on cocos2d-x 2.2.0. but when i'm doing same thing in cocos2d-x 3.0 beta2,the webview can't show. http://blog.csdn.net/jackystudio/article/details/17576995

i noticed that cocos2d-x 3.0 using NativeActivity, is it causing webview can't show? Cocos2d-x: possible to use HTML (UIWebView)?

any suggestion will be greatly appreciated. thx.

Community
  • 1
  • 1

1 Answers1

0

current release of cpp Cocos2d-x v3.2rc0 use Android Activity not NativeActivity. So you can try your linked example from 2.2.0 version. Maybe you get some errors about opengl context or handler - so be sure that your java code will be executed GUI thread - runOnUiThread.

Here is the little sample how to do it, in another way: ANDROID:How to open web page in class extends CCLayer

Main point is to run android gui thread:

Handler handler = HomeMenu.getHandler();
    handler.post(new Runnable() {
        public void run() {...
Community
  • 1
  • 1
Elensar
  • 124
  • 1
  • 9