Adding admob or mobclix to wiengine android app
I'm trying to implement some mobclix ads into an android app based on wiengine which is basically a java port of cocos2d. 开发者_运维问答Has anyone tried doing this? if so please tell me how ;)
To be clear the basic problem is that because wiengine uses a nonstandard View based class (WYGLSurfaceView) you can't easily add another ad View on top of the existing one.
Thanks,
Nick
use Activity.addContentView, samples:
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.FILL_PARENT,
FrameLayout.LayoutParams.WRAP_CONTENT);
lp.gravity = Gravity.BOTTOM;
lp.bottomMargin = 10;
AdView ad = new AdView(this);
ad.setResId("xxx");
ad.setGoneIfFail(true);
addContentView(ad, lp);
ad.requestAd();
full answer: http://blog.wiyun.com/?cat=8
Well I'm not sure if it will answer your question but we can push a new activity:
Intent toInfoIntent = new Intent(Director.getInstance().getContext(), InfoActivity.class);
Director.getInstance().getContext().startActivity(toInfoIntent);
精彩评论