我的應用的屏幕看起來像this Screenshot。Android應用圖標和名稱在應用中多次出現
正如你所看到的我做了一個廣告應用(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中沒有錯誤信息和應用程序didnt崩潰。希望你能幫助! 我已經重新啓動手機並重新啓動了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>
你能發表更多的信息嗎?這是完整的佈局xml嗎? // Ist das derVollständigeCode? zumindest是死的xml angeht ..? sehr // verwirrend .. –
這是完整的xml // hi du kannst ja deutsch reden。 Ja das ist die ganze layout datei – user2502514
can you show me the manifest.xml?並且activity_fullscreen是給定的佈局? // ja hab an der werbung gesehn dass du deutsch bist =)siewar zwar alles richtig aus aber hier nochmal ein tut .. btw。這裏是一個教程http://www.wikihow.com/Add-Advertisements-to-Your-Android-Applications-Using-Admob –