コード例 #1
0
  private void broadcastChange() {
    Zup.getInstance().updateSyncAction(this);

    Intent intent = new Intent(SyncAction.ACTION_SYNC_CHANGED);
    intent.putExtra("sync_action", this);

    if (ZupApplication.getContext() == null) return;

    LocalBroadcastManager manager = LocalBroadcastManager.getInstance(ZupApplication.getContext());
    manager.sendBroadcast(intent);
  }
 @Override
 public void onClick(View view) {
   if (!Utilities.isConnected(getActivity())) {
     ZupApplication.toast(getView(), R.string.only_online_option_error).show();
     return;
   }
   switch (view.getId()) {
     case R.id.responsable_group_container:
       selectGroup();
       break;
     case R.id.responsable_user_container:
       selectUser();
       break;
   }
 }
 private void selectUser() {
   if (getItem().assignedGroup == null) {
     ZupApplication.toast(getView(), R.string.please_assign_responsable_group_message).show();
     return;
   }
   UserPickerDialog dialog = new UserPickerDialog();
   Bundle bundle = new Bundle();
   bundle.putInt("groupId", getItem().assignedGroup.getId());
   dialog.setArguments(bundle);
   dialog.show(getActivity().getSupportFragmentManager(), "user_picker");
   dialog.setListener(
       new UserPickerDialog.OnUserPickedListener() {
         @Override
         public void onUserPicked(User user) {
           assignResponsableUser(user);
         }
       });
 }