Note that there are some explanatory texts on larger screens.

plurals
  1. POStartApp Ad not showing on my App
    primarykey
    data
    text
    <p>For some reason,StartApp ads are not showing on my application, despite having followed their setup instructions in the pdf they provided on their site.</p> <p>I implemented callbacks on the <code>showAd()</code> and <code>loadAd()</code> methods and noted that ads are received but not shown. I later created a rectangular background on the view where start app Ad would be shown.I noticed the view with my rectangular border is shown when the ad is loaded but their is no ad content inside the view. See attached image.</p> <p>In the log cat, 'Ad received' is reported but never ' Ad displayed' or 'Ad hidden' messages from my callbacks.</p> <p>When I click on the Ad view, my app crashed with Array Index out of bounds exception thrown from the StartApp lib. </p> <p>See images and code snippets.</p> <p>My Show add runnable:</p> <pre><code> private Runnable showAdRunnable = new Runnable() { @Override public void run() { /* WAS HERE BUT STILL COULDNT SHOW startAppAd.showAd(new AdDisplayListener() { @Override public void adHidden(Ad ad) { Log.d(TAG, "Ad hidden "+ad.getErrorMessage()); } @Override public void adDisplayed(Ad ad) { Log.d(TAG, "Ad displayed "+ad.getErrorMessage()); } }); */ startAppAd.loadAd (new AdEventListener() { @Override public void onReceiveAd(Ad ad) { Log.d(TAG, "Ad received "+ad.getErrorMessage()); startAppAd.showAd(new AdDisplayListener() { @Override public void adHidden(Ad ad) { Log.d(TAG, "Ad hidden "+ad.getErrorMessage()); } @Override public void adDisplayed(Ad ad) { Log.d(TAG, "Ad displayed "+ad.getErrorMessage()); } }); } @Override public void onFailedToReceiveAd(Ad ad) { Log.d(TAG, "Ad not received "+ad.getErrorMessage()); } }); try { Thread.sleep(200); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } showing = false; } }; </code></pre> <p>My <code>onCreate()</code></p> <pre><code>/** * Called when the activity is first created. */ @Override public void onCreate(final Bundle savedInstanceState) { Log.d(TAG, "onCreate()"); StartAppAd.init(this, "XXXXXXX", "YYYYYYY"); super.onCreate(savedInstanceState); setContentView(R.layout.main); // initialize the coin image and result text views initViews(); // initialize the onclick listener coinImage.setOnClickListener(new OnClickListener() { @Override public void onClick(final View v) { tossCoin(); } }); initSounds(); showing = true; new Handler().postDelayed(showAdRunnable , 2*1000); } </code></pre> <p><code>tossmyCoin()</code> method. This is called when the user clicks on the coin image on my app to toss the coin. I want to refresh the Ad every time the user tosses a coin, so I did:</p> <pre><code>private void tossCoin() { .... if (!showing) { showing = true; new Handler().postDelayed(showAdRunnable , 2*1000); } } </code></pre> <p>How Ad is shown: <img src="https://i.stack.imgur.com/zsbOw.png" alt="Empty Ad section"></p> <p>When I click on the Ad section, my app crashes and the log cat contains the following:</p> <pre><code>10-21 01:38:47.851: E/AndroidRuntime(23900): FATAL EXCEPTION: main 10-21 01:38:47.851: E/AndroidRuntime(23900): java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 10-21 01:38:47.851: E/AndroidRuntime(23900): at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257) 10-21 01:38:47.851: E/AndroidRuntime(23900): at java.util.ArrayList.get(ArrayList.java:311) 10-21 01:38:47.851: E/AndroidRuntime(23900): at com.startapp.android.publish.banner.banner3d.Banner3D.onTouchEvent(Unknown Source) 10-21 01:38:47.851: E/AndroidRuntime(23900): at android.view.View.dispatchTouchEvent(View.java:3885) 10-21 01:38:47.851: E/AndroidRuntime(23900): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload