Skip to content

Instantly share code, notes, and snippets.

@robisaks
Created March 7, 2013 03:14
Show Gist options
  • Save robisaks/5105321 to your computer and use it in GitHub Desktop.
Save robisaks/5105321 to your computer and use it in GitHub Desktop.
// initialize K2
K2.initialize("XXXXXXXXX", "XXXXXXXXXX", this);
// Check to see if we have an active campaign to utilize
if(K2.hasActiveCampaign()) {
K2Banner banner = K2.getCurrentCampaign().getBanner(this);
if(banner != null) {
FrameLayout layout = (FrameLayout)findViewById(R.id.ad_placement);
banner.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
layout.addView(banner);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment