William L. William L. - 1 year ago 79
Android Question

Don't let AdMob ads request focus?

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?


<com.google.ads.AdView android:id="@+id/adView"

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.

Answer Source

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 the AdView when hitting "Next".

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download