开发者

Admob not showing - issues?

开发者 https://www.devze.com 2023-04-02 06:20 出处:网络
sorry for my language i cant speak/write fluently english but i have a problem. I\'ve done with m aplication but i dont get my admob and its not showing to my device, when i run to emulator its ok but

sorry for my language i cant speak/write fluently english but i have a problem. I've done with m aplication but i dont get my admob and its not showing to my device, when i run to emulator its ok but when i install the application to my device before publishing to the market it dont shows up why here is my code:

My MainActivity.class

public class MainActivity extends Activity implements OnClickListener{

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        AdView adview = (AdView)findViewById(R.id.adView1);
        AdRequest re = new AdRequest();
        re.setTesting(true);
        adview.loadAd(re);

My Main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"      
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" android:background="@drawable/worldsbackground" >

&l开发者_如何学Pythont;com.google.ads.AdView 
android:id="@+id/adView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="My_Publisher_ID"
/>

and Manifest.xml

<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation"/>


<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

Can Somebody help Me?

Thanks


Your LinearLayout is using fill_parent which fill's up the whole screen and there is no space left on the screen

0

精彩评论

暂无评论...
验证码 换一张
取 消