views:

26

answers:

0

I'm using Twitter4j in asynchronous mode. When I get response in Listener I want to be able to change some Views in my Activity but it results in CalledFromWrongThreadException.

I know that I can use runOnUiThread method, but what is the most elegant solution for this apart from inlining Runnable Classes?

Part of my Activity:

    TwitterListener listener = new TwitterAdapter() {

        @Override
        public void gotUserDetail(User user) {
            super.gotUserDetail(user);

            fillInUserProfileDetails(user);