What's new
DroidForums.net | Android Forum & News

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Admob not show with GLSurfaceView

BonkS

New Member
Hello. Please help with my problem. Advertising admob works, before the last update. Right now it only shows if you hide or remove GLSurfaceView, together is not visible.


/////////// Manifest.xml ///////////////////
.......
<! - The application's publisher ID assigned by AdMob ->
<meta-data android:value="a6d534fd4455d" android:name="ADMOB_PUBLISHER_ID" />


<Activity android: name = "com.admob.android.ads.AdMobActivity"
android: theme = "@ android: style / Theme.NoTitleBar.Fullscreen"
android: configChanges = "orientation | keyboard | keyboardHidden" />

<! - Track Market installs ->
<receiver android:name="com.admob.android.ads.analytics.InstallReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</ Intent-filter>
</ Receiver>
<uses-permission android:name="android.permission.INTERNET" />
.......
/////////////////////
//////////////// Main.xml //////////////////////
<? Xml version = "1.0" encoding = "utf-8"?>
<LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android"
xmlns: myapp = "http://schemas.android.com/apk/res/com.tastyplay.android.myapp"
android: orientation = "vertical" android: layout_width = "fill_parent"
android: layout_height = "fill_parent"
>

<android.opengl.GLSurfaceView android:id="@+id/glSurface" android:layout_width="fill_parent" android:layout_height="320px"/>
<Com.admob.android.ads.AdView android: id = "@ + id / ad" android: layout_width = "fill_parent" android: layout_height = "wrap_content" android: layout_alignParentBottom = "true" myapp: backgroundColor = "# 000000" myapp: primaryTextColor = "# FFFFFF" myapp: secondaryTextColor = "# CCCCCC" myapp: keywords = "Android game" />
</ LinearLayout>

////////////////// Main.java
@ Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView (R.layout.main);
AdView adt = (AdView) this.findViewById (R.id.ad);
adt.setVisibility (AdView.VISIBLE);
AdManager.setTestDevices (new String [] {"3BD47AAD2E005DEFB5930E2544AB0DC5"});
adt.requestFreshAd ();
glSurface = (GLSurfaceView) this.findViewById (R.id.glSurface);
glSurface.setRenderer (new OpenGlRender (this));
 
Back
Top