Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问在原生的代码中可以获取到当前flutter所在的activity吗? #87

Open
LiuDongCai opened this issue Dec 22, 2021 · 2 comments

Comments

@LiuDongCai
Copy link

比如dart_native,我调原生的一个方法,需要弹窗,需要判断当前activity是否destroy等,我如何拿到这个activity呢

@yulingtianxia
Copy link
Member

理论上其实是可以的,毕竟能调用任意 java 方法

@hui19
Copy link
Member

hui19 commented Dec 24, 2021

@LiuDongCai 原生可以暴露 getActivity 函数,dart 拿到 activity 对象调用它的方法就可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants