/** Start the vote phase */ private void startVotePeriod() { for (Participant p : poll.getParticipants().values()) { if (!p.hasAcceptedReview()) { for (int i = 0; i < 2; i++) Toast.makeText(this, R.string.toast_not_everybody_accepted, Toast.LENGTH_LONG).show(); return; } } poll.setStartTime(System.currentTimeMillis()); AndroidApplication.getInstance().getProtocolInterface().beginVotingPeriod(poll); }
@Override public void onReceive(Context context, Intent intent) { LocalBroadcastManager.getInstance(ReviewPollAdminActivity.this).unregisterReceiver(this); Poll poll = (Poll) intent.getSerializableExtra("poll"); if (isContainedInParticipants( AndroidApplication.getInstance().getNetworkInterface().getMyUniqueId(), poll.getParticipants().values())) { Intent i = new Intent(context, VoteActivity.class); i.putExtras(intent.getExtras()); AndroidApplication.getInstance().getCurrentActivity().startActivity(i); } else { Intent i = new Intent(context, WaitForVotesAdminActivity.class); i.putExtras(intent.getExtras()); AndroidApplication.getInstance().getCurrentActivity().startActivity(i); } }