Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1.     @BindView(R.id.adView) AdView mAdView;
  2.  
  3.     @Override
  4.     protected void onCreate(Bundle savedInstanceState) {
  5.         MobileAds.initialize(getApplicationContext(), getString(R.string.ad_unit_id));
  6.         mAdView.setAdListener(null);
  7.         if (!Constants.IS_FREE_VERSION) {
  8.             mAdView.setVisibility(View.GONE);
  9.         } else {
  10.             mAdView.loadAd(new AdRequest.Builder().build());
  11.         }
  12.     }
  13.  
  14.     @Override
  15.     protected void onDestroy() {
  16.         super.onDestroy();
  17.         mAdView.destroy();
  18.     }
  19.  
  20.     @Override
  21.     protected void onPause() {
  22.         mAdView.pause();
  23.         super.onPause();
  24.     }
  25.  
  26.     @Override
  27.     protected void onResume() {
  28.         super.onResume();
  29.         mAdView.resume();
  30.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement