Guys,
I had the same problem. To work around it, I delay the ad request, so
my users can rotate rapidly all they want. Apparently, that's what
they wanted to do, because I got a lot of these errors.
I build my AdView in onCreate (because you can't do it on another
thread), then put the ad.loadAd(adRequest) in a "GetAd" Runnable. The
"GetAd" is executed with runOnUiThread (because you can't do it from
another thread either), which I post from another "AdHandler" thread I
start in onCreate. So, the AdView constructs, "GetAd" starts, waits
for a bit, then posts "AdHandler" to run ad.loadAd(adRequest) (which
is then AyschTask executed, unfortunately).
I pause 1000 ms. I suppose I could make it shorter, but I was getting
the error because I have an activity where a lot of my users will
enter the activity and immediately (or nearly immediately) slide out
the keyboard/rotate the phone. If the activity dies before the
thread.wait() ends, so does the thread and the AsychTask queuing
problem is reduced.
Well, it works except now I get an occasional NPE from the "c.a" class
- which from your comments above seems to be the cancellation
AsychTask trying to kill my AdView that is no longer there due to
phone rotation. To complicate things, I noticed my app cache would get
very large (not only do my users like to rotate the phone, but they
sit in the app and cache ad images). So, I implemented a forced cache
delete. I haven't seen this specifically create a problem, but I
haven't been able to rule it out yet, either. I'm worried the cache
delete causes the "c.a" class to NPE from time to time, but I had
users with persistent 6MB+ cache; and the performance problems that go
with that kind of thing.
Are you guys seeing this problem? The pause on the ad request means
fewer errors, but every error is still a FC to the user... in my app.
The cache delete also helped put the brakes on the OutOfMemory errors.
Thanks,
Jim
SPA