How does weex's customized WXComponent on the Android side override the onBackPressed method of the host Activity?
漂亮男人
漂亮男人 2017-05-16 13:22:27
0
2
887

As the title states, the OnBackPressed method of the activity needs to be monitored in the rewritten component. How to implement it in the Component. Do you need to override onActivityBack?

漂亮男人
漂亮男人

reply all(2)
漂亮男人

In the Component拿到你要操作的activity instance, then listen to the method you want

漂亮男人

Yes, override the onActivityBack就可以。不过需要注意的是,需要在你的宿主ActivityonBackPressed方法中,调用WXSDKInstanceonActivityBack method.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!