Skip to content

Instantly share code, notes, and snippets.

@csdear
Created March 5, 2014 21:17
Show Gist options
  • Select an option

  • Save csdear/0470be20cb71d89bcae3 to your computer and use it in GitHub Desktop.

Select an option

Save csdear/0470be20cb71d89bcae3 to your computer and use it in GitHub Desktop.
Views : ListView ListView is a view group that displays a list of scrollable items. The list items are automatically inserted to the list using an Adapter that pulls content from a source such as an array or database query and converts each item result into a view that's placed into the list.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//Creating an adapter to populate the listview
mAdapter = new ToDoListAdapter(getApplicationContext());
// Put divider between ToDoItems and FooterView
getListView().setFooterDividersEnabled(true);
// Inflate footerView for footer_view.xml file
TextView <<tvInstanceName>> = (TextView) getLayoutInflater().inflate(R.layout.<<XMLlayoutTextView, null);
//Calling ListView.java methods.
getListView().addFooterView(tvInstanceName);
//TODO - Add view instance to ListView
ListView lv = getListView();
lv.addFooterView(<<tvInstanceName);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment