You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ji...@apache.org on 2017/02/20 06:41:14 UTC

[25/50] [abbrv] incubator-weex git commit: V0.10.0 stable moudle sync doc (#179)

V0.10.0 stable moudle sync doc (#179)

* * [android] add sync callback develop doc

* * [android] delete  space line

* Update extend-to-android.md


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/3bab1459
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/3bab1459
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/3bab1459

Branch: refs/heads/master
Commit: 3bab145900c6b971776c57b2f7ef5c309c3fd313
Parents: 36ed260
Author: zhengshihan <zh...@gmail.com>
Authored: Thu Feb 16 16:34:34 2017 +0800
Committer: sospartan zheng <so...@apache.org>
Committed: Thu Feb 16 16:34:34 2017 +0800

----------------------------------------------------------------------
 doc/advanced/extend-to-android.md | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3bab1459/doc/advanced/extend-to-android.md
----------------------------------------------------------------------
diff --git a/doc/advanced/extend-to-android.md b/doc/advanced/extend-to-android.md
index b4bae71..1d49dfd 100644
--- a/doc/advanced/extend-to-android.md
+++ b/doc/advanced/extend-to-android.md
@@ -29,7 +29,22 @@ Refer to the following example:
     }
 
 ```
+#### Support synchronous/asynchronous callback 
+you can add  `` @JSMethod (uiThread = false or true ) `` annotation to choose the  callback mode of moudle . see the follow  example.
+```java
+     // as sync-callback mode 
+    @JSMethod (uiThread = false)
+    public void testSyncCall(){
+        WXLogUtils.d("WXComponentSyncTest :"+ Thread.currentThread().getName());
+    }
+    
+    // as async-callback mode 
+    @JSMethod (uiThread = true)
+    public void testAsyncCall(){
+        WXLogUtils.e("WXComponentASynTest :"+ Thread.currentThread().getName() );
+    }
 
+```
 #### Register the moulde
 
 ```java