Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ad.show(this, Ad.INTERSTITIAL);
- private static const int DEF_INTERVAL = 500;
- private int mInterval = DEF_INTERVAL;
- private Handler mHandler;
- @Override
- protected void onCreate(Bundle bundle) {
- mHandler = new Handler();
- startTask();
- }
- Runnable mAdShower = new Runnable() {
- @Override
- public void run() {
- try {
- Ad.show(this, Ad.INTERSTITIAL);
- } finally {
- mHandler.postDelayed(mAdShower , mInterval);
- }
- }
- };
- void startTask() {
- mAdShower.run();
- }
- void stopTask() {
- mHandler.removeCallbacks(mAdShower);
- }
Add Comment
Please, Sign In to add comment