1

I have a fragment activity which contains a ListView, and i need to add a button at the bottom of the list. This is a part of the code:

public class listview1 extends Fragment implements OnItemClickListener {    

ListView list;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstances){
    View rootView = inflater.inflate(R.layout.activity_main, container, false);
    list = (ListView) rootView.findViewById(R.id.listView);
    list.setAdapter(new CustomBaseAdapter(this.getActivity()));     
    list.setOnItemClickListener(this);
    return rootView;
}

- CustomBaseAdapter extends a BaseAdapter which has a getView() method and all...

Randhir Singh
  • 101
  • 1
  • 6
  • possible duplicate of [How to add a footer in ListView?](http://stackoverflow.com/questions/4265228/how-to-add-a-footer-in-listview) – VM4 Oct 26 '14 at 15:48

1 Answers1

0

just go to your xml file and type this code inside the

 <Button
          android:id="@+id/button1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Button" />

I personally tested it and found it working

The xml file is in res -> layout ->yourfilename.xml

Hasan
  • 36
  • 1
  • 16