Perhaps i'm not understanding what you're saying, but why can you not do it with your xml layout?
<Button .... /> <ListView ..... /> Here's an example XML that seems to work, maybe you can tailor it to your needs? <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/MainPageLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:id="@+id/text_main_screen_instructions" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceSmall" android:gravity="center_vertical" android:paddingLeft="6dip" android:paddingRight="6dip" android:text="@string/main_screen_instructions" android:layout_alignParentTop="true"/> <Button android:id="@+id/close" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:text="test" android:layout_below="@id/text_main_screen_instructions" /> <ListView android:id="@+id/listView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textAppearance="?android:attr/textAppearanceMedium" android:gravity="center_vertical" android:paddingLeft="6dip" android:paddingRight="6dip" android:layout_below="@id/close"/> ........ On Thu, Jul 29, 2010 at 5:25 PM, calmchess <calmchesspla...@gmail.com>wrote: > Hi I'm using a custom list view by extending a class with > BaseAdapter this works well displays all my data however i want to add > a single button above the listview without useing addheader but I > don't know how to add it to the baseAdapter or getView method if i add > the button to main.xml each cell of the listview is populated with a > button this is undesireable i only want 1 button above the > listview.....please help me to add the button. the below code is for > refrence > > public class customlistview extends Activity implements > OnClickListener{ > ListView l1; > private static class EfficientAdapter extends BaseAdapter { > private LayoutInflater mInflater; > private ArrayList<ArrayList<String>> ret=null; > > -- > You received this message because you are subscribed to the Google > Groups "Android Beginners" group. > > NEW! Try asking and tagging your question on Stack Overflow at > http://stackoverflow.com/questions/tagged/android > > To unsubscribe from this group, send email to > android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/android-beginners?hl=en > -- //Nick Richardson //richardson.n...@gmail.com -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en