@Override public boolean onFired(ActionContext<? extends Application> context) { if (context.getApp().checkInternetAvailableAndRequired(context.getActivity())) { try { final SyncService service = syncServiceProxy.getService(); if (service != null) { doSync(context, service); } } catch (IllegalStateException ex) { cancelSync(context); } } return true; }
public void onDestroy() { syncServiceProxy.removeListener(this); }
@Inject public SyncAction(SyncServiceProxy syncServiceProxy) { this.syncServiceProxy = syncServiceProxy; syncServiceProxy.addListener(this); }