We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
//Activity has a Fragmnet protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); EventBus.getDefault().register(this); EventBus.getDefault().post("Jay Music","ticket"); } @Subcriber(tag = "ticket") public void onEvent(String event) { Log.e("","I got " + event +"ticket") }
在Activity是沒有問題的,可以看到Log at Activity ,Log is showing
//Fragment @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); EventBus.getDefault().register(this); } @Subcriber(tag = "ticket") public void onEvent(String event) { Log.e("","I got " + event +"ticket") }
但在Fragment上卻無法顯示Log Bug at Fragment , I can't get Log
The text was updated successfully, but these errors were encountered:
我的錯 My fault
下面Code是正常的 The code is work
//Fragmnet ViewModel viewModel; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { viewModel = new ViewModel(this); }
//ViewModel public ViewModel(Fragmnet frg){ EventBus.getDefault().register(this); } @Subcriber(tag = "ticket") public void onEvent(String event) { Log.e("","I got " + event +"ticket") }
Sorry, something went wrong.
没事,希望尽量给出意见。刚才发现一些问题,我刚才更新了一下代码,你也更新一下吧。thanks~
No branches or pull requests
問題 Q
在Activity是沒有問題的,可以看到Log
at Activity ,Log is showing
但在Fragment上卻無法顯示Log
Bug at Fragment , I can't get Log
The text was updated successfully, but these errors were encountered: