You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2017/05/05 11:25:45 UTC
[12/23] incubator-weex git commit: * [android] use Activity class to
construct intent for opening url
* [android] use Activity class to construct intent for opening url
old way ‘new Intent(WEEX_ACTION, uri)’ will crash after android 7.0
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/dd29a23d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/dd29a23d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/dd29a23d
Branch: refs/heads/0.13-dev
Commit: dd29a23d6634a368218dad013aa404b2f3bfa8c6
Parents: 2aafe9d
Author: sospartan <so...@apache.org>
Authored: Thu May 4 18:28:11 2017 +0800
Committer: sospartan <so...@apache.org>
Committed: Thu May 4 18:28:11 2017 +0800
----------------------------------------------------------------------
.../main/java/com/alibaba/weex/extend/module/WXEventModule.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/dd29a23d/android/playground/app/src/main/java/com/alibaba/weex/extend/module/WXEventModule.java
----------------------------------------------------------------------
diff --git a/android/playground/app/src/main/java/com/alibaba/weex/extend/module/WXEventModule.java b/android/playground/app/src/main/java/com/alibaba/weex/extend/module/WXEventModule.java
index 098681d..10a51cd 100644
--- a/android/playground/app/src/main/java/com/alibaba/weex/extend/module/WXEventModule.java
+++ b/android/playground/app/src/main/java/com/alibaba/weex/extend/module/WXEventModule.java
@@ -22,6 +22,7 @@ import android.content.Intent;
import android.net.Uri;
import android.text.TextUtils;
+import com.alibaba.weex.WXPageActivity;
import com.taobao.weex.annotation.JSMethod;
import com.taobao.weex.common.WXModule;
@@ -49,7 +50,9 @@ public class WXEventModule extends WXModule {
}
Uri uri = Uri.parse(builder.toString());
- Intent intent = new Intent(WEEX_ACTION, uri);
+ Intent intent = new Intent(mWXSDKInstance.getContext(),WXPageActivity.class);
+ intent.setAction(WEEX_ACTION);
+ intent.setData(uri);
intent.addCategory(WEEX_CATEGORY);
mWXSDKInstance.getContext().startActivity(intent);