title: How to set a click count to display an object?
body: <p>I thought I got this working but I haven't. Basically I am counting the number of clicks the user is doing and as a test I want to state for every three clicks (the number of clicks divides by 3), then display an interstitial advert.</p>
  
  <p>The problem I have realised is for the first three clicks or the first number that divides into 3, it shows the advert. However if I continue with the clicks then the advert never appears again.</p>
  
  <p>What am I doing wrong and how can I get the advert to constantly appear based on my number of clicks condition?</p>
  
  <pre><code>public class Content extends AppCompatActivity {
  
      Button selectAnotherButton;
      TextView clickCountText;
      int getClickCountInt;
  
      private InterstitialAd mInterstitialAd;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_content);
  
          MobileAds.initialize(Content.this, "ca-app-pub-...");
          mInterstitialAd = new InterstitialAd(Content.this);
          mInterstitialAd.setAdUnitId("ca-app-pub-.../...");
          mInterstitialAd.loadAd(new AdRequest.Builder().build());
  
          final SharedPreferencesManager prefManager = SharedPreferencesManager.getInstance(Content.this);
          clickCountText = findViewById(R.id.click_count);
          clickCountText.setText(Integer.toString(prefManager.getClicks()));
          getClickCountInt = Integer.parseInt(clickCountText.getText().toString());
  
          selectAnotherButton = findViewById(R.id.button_select_another);
  
          selectAnotherButton.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  getClickCountInt++;
                  clickCountText.setText(Integer.toString(prefManager.increaseClickCount()));
  
  
                  if(getClickCountInt % 3 == 0){
  
                      if (mInterstitialAd.isLoaded()) {
                          mInterstitialAd.show();
                      } else {
                          Log.d("ADVERT", "The interstitial wasn't loaded yet.");
                      }
                  }
  
              }
          });
  
  
      }
  
  
  
  }
  </code></pre>