Follow

Hiding an In-App Banner Ad

A publisher asked a question:

 

Hi StartApp,

I added an xml that described a banner in my view like this

<com.startapp.android.publish.banner.Banner 
android:id="@+id/startAppBanner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true" >
</com.startapp.android.publish.banner.Banner>

In the relevant code file, I followed your instruction like the 3 lines below

startAppAd = new StartAppAd(this); 
startAppAd.showAd();
startAppAd.loadAd();

But the startAppAd variable does not include the setVisibility method, which I can make the banner be invisibility. Instead, I replaced the 3 lines of above code like this

Banner x = (com.startapp.android.publish.banner.Banner) findViewById(R.id.startAppBanner); 
x.setVisibility(View.GONE);

I think that the banner will be gone but nothing changed. The banner is still be visible. How can I do to make the banner become invisible or be gone?

Hello,

Thank you for your patience.

You can call the method:

startAppBanner.hideBanner();

This should work.

If you have any more questions, please let me know.

Regards,

Matthew

Was this article helpful?
4 out of 4 found this helpful
Have more questions? Submit a request

Comments