Back to project page Android-RxJava.
The source code is released under:
Apache License
If you think the Android project Android-RxJava listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.morihacky.android.rxjava.rxbus; //from w w w . j a v a2 s .com import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import butterknife.ButterKnife; import butterknife.OnClick; import com.morihacky.android.rxjava.MainActivity; import com.morihacky.android.rxjava.app.R; public class RxBusDemo_TopFragment extends Fragment { private RxBus _rxBus; @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View layout = inflater.inflate(R.layout.fragment_rxbus_top, container, false); ButterKnife.inject(this, layout); return layout; } @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); _rxBus = ((MainActivity) getActivity()).getRxBusSingleton(); } @OnClick(R.id.btn_demo_rxbus_tap) public void onTapButtonClicked() { if (_rxBus.hasObservers()) { _rxBus.send(new RxBusDemoFragment.TapEvent()); } } }