如何将值从react-native发送到android活动? [英] How to send a value from react-native to android activity?

查看:54
本文介绍了如何将值从react-native发送到android活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将来自本地本机Listview的rowId发送到我的android活动中的方法之一.原因是我正在将React集成到现有的android应用中.因此,为了时间起见,我想发送rowID进行进一步处理.有什么想法吗?

I want to send a rowId from react native Listview to one of method in my android activity.the reason is I am integrating react to an existing android app. so for the time sake I wana send rowID for further process. Any idea on this?

推荐答案

看看 Android反应模块&反应模块IOS

这是与React组件和本机组件进行通信的唯一方法.

This is the only way to communicate with React component and native component.

您需要在模块中创建一个react方法,并使用该方法来接受值并将其发送给本机活动.

You need to create a react method in module and use that to accept the value and send it across to native activity.

这篇关于如何将值从react-native发送到android活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆