简体   繁体   English

Android应用程序图标和名称在应用程序中多次出现

[英]Android App Icon and Name appears multiple times in app

My app's screen looks like this Screenshot . 我的应用程序的屏幕如下图所示

As you can see I made an App with ads (admob), but there is a bug, I cant fix. 如您所见,我制作了一个带有广告的应用程序(admob),但是有一个错误,我无法修复。

Code: 码:

private AdView adView;

@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_fullscreen);

    //create adView

    adView = (AdView) findViewById(R.id.adView);

    AdRequest request = new AdRequest();
    adView.loadAd(request);
}

Layout: 布局:

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/linearlayout"
    android:orientation="vertical">

<com.google.ads.AdView
    android:id="@+id/adView"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    ads:adSize="BANNER"
    ads:adUnitId="....."
    ads:testDevices="....." >
</com.google.ads.AdView>

</LinearLayout>

I got no error message in logcat and the app didnt crash. 我在logcat中没有错误消息,并且应用程序没有崩溃。 Hope you can help! 希望能对您有所帮助! I already reboot my phone and restarted eclipse. 我已经重新启动了手机并重新启动了Eclipse。

EDIT: Manifest: 编辑:清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.stefan.game"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="10"
    android:targetSdkVersion="17" />

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

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.stefan.game.FullscreenActivity"
        android:configChanges="orientation|keyboardHidden|screenSize"
        android:label="@string/app_name"
        android:theme="@style/FullscreenTheme" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name="com.google.ads.AdActivity"
              android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>
</manifest>

Firstly try a clean build. 首先尝试一个干净的版本。 IT could be that you are getting the wrong resource ids being applied. 可能是您正在应用错误的资源ID。

Otherwise, try removing the theme attributes for your app and your activity. 否则,请尝试删除应用程序和活动的主题属性。 If the layout XML you provided above is the full XML then I think you have misconfigured the theme such that you either have a list or repeating background that is being incorporated into your activity layout. 如果上面提供的布局XML是完整的XML,那么我认为您对主题的配置错误,因此您有一个列表或重复的背景被合并到您的活动布局中。

You should try to create an integer to count the instances of your ads. 您应尝试创建一个整数以计算广告的实例。 First see if your integer is superior to 1. 首先查看您的整数是否优于1。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM