Android: which thread is native method running in?
Is there any sense in calling a native function from a separate开发者_Python百科 Java thread, or is it already being run in a separate thread by Dalvik VM?
Native methods are run just like other methods(unless specified otherwise in method description). You should handle the cases where you need to to run code that is slow so that UI wont be blocked. There are multiple ways for this, check this:
http://developer.android.com/resources/articles/painless-threading.html
精彩评论