java - Android method annotation for preventing call from being made on GUI thread -


in project i'm working on there plenty of caching done on main thread makes app laggy. plan make asynchronous variants of these, still keeping synchronous calls easier chaining when combined in asynctasks. problem have want prevent usage of caching functions in gui thread in intuitive way. ideas? possible? possible mark method annotation prevents being called on gui thread?

http://androidannotations.org/ provides library leverages use of annotations deal this. have annotations such @uithread , @background replace need use runonuithread() , asynctask respectively.

if you're interested, here's paper discussing similar system dealing blocking of ui thread operations non-ui threads.


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -