If it’s possible, how can I add a “header” above the layout I’ve got assigned to my SimpleCursorAdapter (“ondemandandautomatic_authorize”), and a button below the ListView?
SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(this,
R.layout.ondemandandautomatic_authorize, mContacts,
new String[] { ContactsContract.Contacts.DISPLAY_NAME },
new int[] { R.id.contactLabel });
setListAdapter(mAdapter);
What I’ve got displaying now in my Activity is:
<AppName>
<ckbx1><ckbx2><ckbx3><TextView (ContactName)>
...(repeating the line above for each contact)
But what I want is:
<AppName>
<TextView1><TextView2><TextView3><TextView4>
<ckbx1> <ckbx2> <ckbx3> <TextView (ContactName)>
...(repeating the line above for each contact)
<Button>
Possible?
Use Listviewinstance.addHeaderView(viewtobeadded) for list header part and
Listviewinstance.addFooterView(buttontobeadded) for the button at the bottom of the footer part.
Please make sure that these footer and header addition things must be done before setting adapter on your listview.