Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // The app consists of MainActivity.java and SearchResultFragment.java at which I don't want to show Ads and few other fragemnt with Ads.
- // The Appodeal bottom banner is handled only in the Activity.
- // In onCreate() method there is initilization:
- Appodeal.initialize(this, appKey, Appodeal.INTERSTITIAL | Appodeal.BANNER_BOTTOM);
- // and then call for showing bottom banner
- Appodeal.show(this, Appodeal.BANNER_BOTTOM);
- // in onResume I call:
- Appodeal.onResume(this, Appodeal.BANNER_BOTTOM);
- // In MainActivity I created public methods for showing/hiding apps (I know that interface is better option, but it also don;t work this way)
- public void showAds() {
- Appodeal.show(this, Appodeal.BANNER_BOTTOM);
- }
- public void hideAds() {
- Appodeal.hide(this, Appodeal.BANNER_BOTTOM);
- }
- // For the SearchResultFragment itself in Oncreate I'm hiding the ads:
- ((MainActivity) getActivity()).hideAds();
- // In onStop method I'm trying to show the ads:
- ((MainActivity) getActivity()).showAds();
- // To sum up, ads are hiding, but after that, calling showsAds(); does not seem to work (it is invoked though).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement