Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I hide StartApp ad on my app?

I want to hide/stop the 3d banner ad when user makes an inapp purchase. But I can't figure out how to.

The ad starts automatically when the activity is launched and there is no way of stopping it

<com.startapp.android.publish.banner.banner3d.Banner3D
    android:id="@+id/startApp3DBanner"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"

    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true" />

.

@Override
    protected void onResume() {
        // TODO Auto-generated method stub
        super.onResume();
        startAppAd.onResume();

.

@Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        StartAppAd.init(this, C.STARTAPP_DEV_ID, C.STARTAPP_APP_ID);
        setContentView(R.layout.main_activity);
        startAppAd = new StartAppAd(this);
like image 912
code511788465541441 Avatar asked Mar 22 '23 00:03

code511788465541441


1 Answers

You can use the following line to hide the banner:

((Banner3D) findViewById(R.id.startApp3DBanner)).hideBanner();

And:

((Banner3D) findViewById(R.id.startApp3DBanner)).showBanner();

For showing it.

like image 117
mikibe Avatar answered Mar 31 '23 13:03

mikibe