EventBus comunication between activity and service
问题 I'm working on an Android application with EventBus library. I have an activity and a service. I want to to fire an event from activity and receive it on service. The activity is: public class MainActivity extends AppCompatActivity { public static final String TAG="ACTIVITY"; @Subscribe(threadMode = ThreadMode.MAIN) public void onMessageEvent(StartEvent event) { Log.d(TAG, "Received message"); Snackbar.make(fab, "Stop task", Snackbar.LENGTH_LONG).show(); txtMessage.setText(event.message); };