private void initializeObjects() { TextView textEventName; Button buttonYourVote; Button btnFinish; // Save object references layoutSelectLocations = (LinearLayout) findViewById(R.id.layoutSelectLocations); layoutCloseEvent = (LinearLayout) findViewById(R.id.layoutCloseEvent); textEventName = (TextView) findViewById(R.id.textEventName); btnFinish = (Button) findViewById(R.id.btnFinish); buttonYourVote = (Button) findViewById(R.id.buttonYourVote); layoutPollLocations = (LinearLayout) findViewById(R.id.layoutPollLocations); layoutPollUserVotes = (LinearLayout) findViewById(R.id.layoutPollUserVotes); layoutPollCounters = (LinearLayout) findViewById(R.id.layoutPollCounters); layoutPollPoll = (LinearLayout) findViewById(R.id.layoutPollPoll); // Restore dialogs restoreDialogs(); // Set listeners for handling events btnFinish.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { finishVoting(); } }); // Restore the 'modified' value modified = getIntent().getBooleanExtra("modified", modified); // Get the current selected event Event event = imin.getUser().getCurrentEvent(); // Put the event name String eventName = event.getName(); textEventName.setText(eventName); if (closing) { buttonYourVote.setText(""); } /* // Check if the event has been created by the user if (event.isAdmin()) { // Check if it is closed if (event.isClosed()) { // Event closed } else { // btnCloseEvent.setVisibility(View.VISIBLE); } } */ }