Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_ballot, container, false); final VIPTabBarActivity myActivity = (VIPTabBarActivity)this.getActivity(); SimpleDateFormat election_date_api_format = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat election_date_display_format = new SimpleDateFormat("MMMM d, yyyy"); TextView election_name_label = (TextView)rootView.findViewById(R.id.ballot_election_name); TextView election_date_label = (TextView)rootView.findViewById(R.id.ballot_election_date); election_name_label.setText(voterInfo.election.name); try { <START> Date election_date = election_date_api_format.parse(voterInfo.election.electionDay); <END> election_date_label.setText(election_date_display_format.format(election_date)); } catch (ParseException e) { Log.e("BallotFragment", "Failed to parse election date " + voterInfo.election.electionDay); election_date_label.setText(voterInfo.election.electionDay); } ArrayList contestInfo = (ArrayList) voterInfo.contests; ArrayAdapter adapter = new ArrayAdapter<String>(myActivity, android.R.layout.simple_selectable_list_item, contestInfo); ListView contestList = (ListView)rootView.findViewById(R.id.ballot_contests_list); contestList.setAdapter(adapter); contestList.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Log.d("ContestsList", "clicked: " + voterInfo.contests.get(position).office); myActivity.showContestDetails(position); } }); return rootView; }</code><technical_language>parsing election_date a string here, consider adding a method Election class returns a nicely formatted date string. SimpleDateFormat objects app</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_ballot, container, false); final VIPTabBarActivity myActivity = (VIPTabBarActivity)this.getActivity(); TextView election_name_label = (TextView)rootView.findViewById(R.id.ballot_election_name); TextView election_date_label = (TextView)rootView.findViewById(R.id.ballot_election_date); election_name_label.setText(voterInfo.election.name); election_date_label.setText(voterInfo.election.getFormattedDate()); ArrayList contestInfo = new ArrayList<String>(voterInfo.contests.size()); for (Contest contest : voterInfo.contests) { if (contest.type == "Referendum") { contestInfo.add(contest.referendumTitle + "\n" + contest.referendumSubtitle); } else { contestInfo.add(contest.office + "\n" + voterInfo.election.name); } } ArrayAdapter adapter = new ArrayAdapter<String>(myActivity, android.R.layout.simple_selectable_list_item, contestInfo); ListView contestList = (ListView)rootView.findViewById(R.id.ballot_contests_list); contestList.setAdapter(adapter); contestList.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Log.d("ContestsList", "clicked: " + voterInfo.contests.get(position).office); myActivity.showContestDetails(position); } }); return rootView; }