Android Question Show Ad Banner Problems

cambopad

Active Member
Licensed User
Longtime User
Dear all B4A lover,

I am trying to integrate HeyZap Ad SDK into my B4A app using Inline Java. I can successfully show Interstitial ad. However, when it come to showing the Banner, I cannot understand how can I do it in Inline Java. The codes to show the banner ad is:

B4X:
import com.heyzap.sdk.ads.BannerAdView;
private BannerAdView bannerAdView;
@Override
public void onCreate(Bundle savedInstanceState) {
    // ...
    Activity activity = this; // Must be an Activity.
    bannerAdView = new BannerAdView(activity);
    // This must be some view in your layout.
    FrameLayout bannerWrapper = (FrameLayout) findViewById(R.id.banner_wrapper);
    // Add the banner ad view to the wrapper.
    bannerWrapper.addView(bannerAdView);
    // Load the banner ad.
    bannerAdView.load();
}

What I don't understand is here:
B4X:
// This must be some view in your layout.
    FrameLayout bannerWrapper = (FrameLayout) findViewById(R.id.banner_wrapper);

Can anyone help me?
 
Top