I got the problem when one activity is in active state when i click the notification for the activity it cannot refreshed. So the suggestion is event bus. Can any one explain the event bus concept
Asked
Active
Viewed 318 times
0
-
Possible duplicate of [Why people use message/event buses in their code?](http://stackoverflow.com/questions/3987391/why-people-use-message-event-buses-in-their-code) – azurefrog Dec 10 '15 at 14:56
1 Answers
1
If i understand your problem correctly, event bus is not your only solution. You can set your activity's android:launchMode="singleTop"
and in your activity's onNewIntent()
method re init your activity. When you get a notification if your activity is in active state, your activity'll catch notification click event in it's onNewIntent
method.
If you want to use Event Bus for this operations you can use Otto Bus. You can find it's example implementation from the link below.
Good luck.

savepopulation
- 11,736
- 4
- 55
- 80