You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 30, 2019. It is now read-only.
i have a problem when send event from activity (with post/produce) to a fragment. the event will be taken from binded service if the activity recevied notification via brodcast receiver when the service received a message.
Activity{
private SMS sms;
... @OverRide
protected void onCreate(@nullable Bundle savedInstanceState) {
...
smsFragment = new TransactionSMSFragment();
getSupportFragmentManager().beginTransaction().add(R.id.stack_container, smsFragment, RegisterServerListFragment.TAG).commit();
}
i have a problem when send event from activity (with post/produce) to a fragment. the event will be taken from binded service if the activity recevied notification via brodcast receiver when the service received a message.
Activity{
private SMS sms;
...
@OverRide
protected void onCreate(@nullable Bundle savedInstanceState) {
...
smsFragment = new TransactionSMSFragment();
getSupportFragmentManager().beginTransaction().add(R.id.stack_container, smsFragment, RegisterServerListFragment.TAG).commit();
}
private BroadcastReceiver smsReceiver = new BroadcastReceiver() {
....
@OverRide
public void onReceive(Context context, Intent intent) {
if(DEBUG)Log.i(TAG, "sms>reciver");
if(intent != null){
SMS sms = smsService.getReceivedMessege();
this.sms = sms;
EventBus.getInstance().post(sms);
}
}
};
@produce
public String produce(){
return this.sms;
}
Fragment{
...
@subscribe
public void subscribeSMS(SMS sms){
Log.d("bus", "sms:" + sms );
}
}
what wrong with those code ? how actually otto work ? thank's