diff --git a/README.md b/README.md index 4c3c5b9..f89416e 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Add the dependency ``` dependencies { - implementation 'com.github.p32929:HouseAds2:1.0.0.15' + implementation 'com.github.p32929:HouseAds2:1.0.0.16' } ``` diff --git a/myhouseads2lib/src/main/java/p32929/myhouseads2lib/HouseAds.java b/myhouseads2lib/src/main/java/p32929/myhouseads2lib/HouseAds.java index 971e999..38d65b0 100644 --- a/myhouseads2lib/src/main/java/p32929/myhouseads2lib/HouseAds.java +++ b/myhouseads2lib/src/main/java/p32929/myhouseads2lib/HouseAds.java @@ -94,11 +94,15 @@ public void doSomethingAfter(double seconds, Runnable runnable) { } private void putBannerAds() { - currentAdView = new MyAdView(context, adArrayList.get(bannerCount)); - if (linearLayout != null) - linearLayout.addView(currentAdView); + try { + currentAdView = new MyAdView(context, adArrayList.get(bannerCount)); + if (linearLayout != null) + linearLayout.addView(currentAdView); - incrementAndSaveCounter(); + incrementAndSaveCounter(); + } catch (Exception e) { + // + } } public void putBannerAds(LinearLayout linearLayoutAds) {