簡體   English   中英

Android應用程序圖標和名稱在應用程序中多次出現

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

我的應用程序的屏幕如下圖所示

如您所見,我制作了一個帶有廣告的應用程序(admob),但是有一個錯誤,我無法修復。

碼:

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);
}

布局:

<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>

我在logcat中沒有錯誤消息,並且應用程序沒有崩潰。 希望能對您有所幫助! 我已經重新啟動了手機並重新啟動了Eclipse。

編輯:清單:

<?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>

首先嘗試一個干凈的版本。 可能是您正在應用錯誤的資源ID。

否則,請嘗試刪除應用程序和活動的主題屬性。 如果上面提供的布局XML是完整的XML,那么我認為您對主題的配置錯誤,因此您有一個列表或重復的背景被合並到您的活動布局中。

您應嘗試創建一個整數以計算廣告的實例。 首先查看您的整數是否優於1。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM