开发者

Admob prevents TextView UI updates with a CountDownTimer in Android?

开发者 https://www.devze.com 2023-01-12 15:42 出处:网络
I\'m adding admob ads to my app that has a CountDownTimer that changes a time countdown display in its onTick() callback function. The time display uses a TextView and is changed via .setText().

I'm adding admob ads to my app that has a CountDownTimer that changes a time countdown display in its onTick() callback function. The time display uses a TextView and is changed via .setText(). Everything works fine until I add the admob code. Seems that the ads break the TextView redraws when running. When I stop the CountDownTimer and update the TextView, the redraw happens. I'm not certain why this is happening, and since CountDownTimer is implemented using os.Handler, I can't think of a better way to do this. Calling TextView.invalidate doesn't work e开发者_StackOverflow中文版ither.

Any ideas?


The AdMob ad SDK uses a few Timer constructions of its own. Those might be interfering with yours or making yours slower at the least. As you already said, raising your interval then helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消