Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flurry Agent causing a CalledFromWrongThreadException exception on Android 2.3.4

When I use the FlurryAgent on a 2.3.4 device I get the following exception:

E/AndroidRuntime: FATAL EXCEPTION: FlurryAgent
        android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.

In my code I made sure everything that is UI related is done on the UI thread. I've tried disabling Flurry's exception capture via FlurryAgent.setCaptureUncaughtExceptions(false) but that did not help.

I find it hard to understand if Flurry is causing this exception or just reporting it, I tend to believe the former as when I comment out all Flurry calls, there is no exception/crash whatsoever.

I use the latest Flurry SDK - 3.2.1

Any ideas?

like image 580
Tom Susel Avatar asked Jul 20 '13 22:07

Tom Susel


1 Answers

There is an issue with AsyncTask in the Android SDK previous to Jelly Bean that can cause this problem under certain conditions. Please, take a look at Flurry's support page, there is a workaround.

like image 53
st_ Avatar answered Sep 22 '22 12:09

st_