0

I am trying to show flurry interstitial but getting following message in debug screen and I am not receiving interstitial on my screen.

07-14 15:55:31.390: W/webview(10588): java.lang.Throwable: Warning: A WebView method was called on thread 'FlurryAgent'. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads.

I have followed this tutorial completely : Android Integration

At present I am working on AndEngine. As error replying I put my all code in UI thread but result is same.

Here is my code for displaying ads :

protected void onCreate(Bundle pSavedInstanceState) {
    super.onCreate(pSavedInstanceState);

    // configure Flurry
    FlurryAgent.setLogEnabled(false);

    // init Flurry
    FlurryAgent.init(MainGameActivity.this, MY_FLURRY_APIKEY);

    mFlurryAdInterstitial = new FlurryAdInterstitial(MainGameActivity.this,
            MY_ADSPACE_NAME);

    FlurryAdTargeting adTargeting = new FlurryAdTargeting();
    // enable test mode for this interstitial ad unit
    adTargeting.setEnableTestAds(true);
    mFlurryAdInterstitial.setTargeting(adTargeting);

    // allow us to get callbacks for ad events
    mFlurryAdInterstitial.setListener(interstitialAdListener);

    mFlurryAdInterstitial.fetchAd();

}

FlurryAdInterstitialListener interstitialAdListener = new FlurryAdInterstitialListener() {

    @Override
    public void onFetched(final FlurryAdInterstitial adInterstitial) {

        adInterstitial.displayAd();
    }

    @Override
    public void onError(final FlurryAdInterstitial adInterstitial,
            FlurryAdErrorType adErrorType, int errorCode) {
        adInterstitial.destroy();
    }

    @Override
    public void onAppExit(FlurryAdInterstitial arg0) {
        // TODO Auto-generated method stub
    }

    @Override
    public void onClicked(FlurryAdInterstitial arg0) {
        // TODO Auto-generated method stub
    }

    @Override
    public void onClose(FlurryAdInterstitial arg0) {
        // TODO Auto-generated method stub
    }

    @Override
    public void onDisplay(FlurryAdInterstitial arg0) {
        // TODO Auto-generated method stub
    }

    @Override
    public void onRendered(FlurryAdInterstitial arg0) {
        // TODO Auto-generated method stub
    }

    @Override
    public void onVideoCompleted(FlurryAdInterstitial arg0) {
        // TODO Auto-generated method stub
    }
};

@Override
protected void onStart() {
    super.onStart();

    FlurryAgent.onStartSession(MainGameActivity.this);

}

@Override
protected void onStop() {
    super.onStop();

    FlurryAgent.onEndSession(MainGameActivity.this);
}

@Override
public void onDestroy() {
    super.onDestroy();
    mFlurryAdInterstitial.destroy();

}

So what can I do in this situation?

halfer
  • 19,824
  • 17
  • 99
  • 186
Siddharth
  • 4,142
  • 9
  • 44
  • 90

0 Answers0