2012-12-04 48 views
0

Image of android app 嗨, 我在我的android應用程序中放置了一個AdMob代碼,但它在軟件啓動鍵盤時會導致問題。看看上面的圖片:當隱藏鍵盤時,AdMob清理EditText

只有當我使用AdMob代碼時,纔會發生這種情況,如果我刪除AdMob代碼,應用程序可以正常工作。 我在移動設備上測試過它,並且具有相同的行爲(EditText已清理)。

Configuraton和代碼

清單

<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10" /> 
<activity android:name="com.google.ads.AdActivity" 
android:configChanges="keyboard|keyboardHidden|orientation|"/> 

Jar文件 GoogleAdMobAdsSdk-4.1.1.jar

佈局

<com.google.ads.AdView 
android:id="@+id/adsense" 
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:layout_gravity="center" 
android:paddingTop="3dp" 
android:paddingBottom="3dp" 
ads:adSize="BANNER" 
ads:adUnitId="xxxxxx999999" 
ads:loadAdOnCreate="true" /> 

你有什麼想法嗎?

謝謝!

馬塞洛

回答

0

SharedPreferences保存了,你回來我希望你知道,可以使用數據回調用Lib

 SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); 
    SharedPreferences.Editor editor = preferences.edit(); 
    editor.putString("Name","Harneet"); 
    editor.commit(); 

    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); 
    String name = preferences.getString("Name",""); 
    if(!name.equalsIgnoreCase("")) 
    { 
    name = name+" Sethi"; /* Edit the value here*/ 
    } 

enter link description here

相關問題