Code example for Fragment

Methods: getActivity, startActivity

0
    	startActivity(new Intent(getActivity(), VoteVoter.class)
			.putExtra("legislator", legislator));
    } 
     
    public void sponsoredBills() { 
    	startActivity(new Intent(getActivity(), BillSponsor.class)
			.putExtra("legislator", legislator));
    } 
     
    public void viewCommittees() { 
    	startActivity(new Intent(getActivity(), CommitteeMember.class)
			.putExtra("legislator", legislator));
    } 
     
    public void districtMap() { 
		String url = Utils.districtMapUrl(legislator.title, legislator.state, legislator.district);
		Uri uri = Uri.parse("geo:0,0?q=" + url);
		Intent mapIntent = new Intent(Intent.ACTION_VIEW, uri); 
		mapIntent.setData(uri);
		 
		Analytics.legislatorDistrict(getActivity(), legislator.bioguide_id);