I have a EditText in a layout, and I also have AdMob ads at the bottom of the layout, when someone enters something in the EditText theres suppose to be a "Done" button in the button right corner of the keyboard, but after I added AdMob it has a "Next" button, and when you press it, it focuses on the Ad! Is there a way to disable this?
My XML:
<com.google.ads.AdView android:id="@+id/adView"
android:focusable="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="XXXXXXXXXXX"
ads:adSize="BANNER"
ads:testDevices="XXXXXXXXXXX"/>
My Java:
if (showAds == true) {
AdView adView = (AdView)this.findViewById(R.id.adView);
adView.loadAd(new AdRequest());
}
Note: I dont know if this matters, but I am using a ViewPager so the AdView is on my Main.xml layout file and the EditText is on the Layout that my ViewPager inflates.
This does not work for me, after editText looses focus ACTION_DONE is triggered, AdMob webView gains focus and stays focused unless user touches the screen. To correct this either remove focus from current focus or close soft keyboard
or close soft keyboard
Just add this tag in your root layout.
Ex.
If you want to retain the "Done" button in your
EditText
, add this attribute to it:android:imeOptions="actionDone"
. This will force the "Done" button to appear on soft keyboards.If you want to retain the "Next" button instead, and have it skip the
AdView
, you can use this method to skip over theAdView
when hitting "Next".