Created
June 13, 2012 19:12
-
-
Save Gowiem/2925853 to your computer and use it in GitHub Desktop.
Adding Header to List Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setContentView(R.layout.list); | |
final ListView installationListView = getListView(); | |
LayoutInflater inflater = getLayoutInflater(); | |
ViewGroup header = (ViewGroup) inflater.inflate(R.layout.header, installationListView, false); | |
TextView headerText = (TextView) header.findViewById(R.id.header_text); | |
headerText.setText("Installations On Live"); // TODO: This should not be hardcoded | |
installationListView.addHeaderView(header, null, false); | |
setListAdapter(new ArrayAdapter<Installation>(InstallationListActivity.this, android.R.layout.simple_list_item_1, installations)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment