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
979
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?
In the
Component
拿到你要操作的activity
instance, then listen to the method you wantYes, override the
onActivityBack
就可以。不过需要注意的是,需要在你的宿主Activity
的onBackPressed
方法中,调用WXSDKInstance
的onActivityBack
method.