I have a problem using the footer of my list view. In fact, I inflate an xml and I send it to the footerView. When my activity appears, my listview is showing and after two or three seconds (sometimes more) my footer is showing. Why is it so long ?
Here is a part of my code :
private View footerView;
@Override
protected void onCreate(Bundle savedInstanceState) {
footerView = ((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.order_footer_item, null);
super.onCreate(savedInstanceState);
}
// This is Android annotation
@AfterViews
protected void setAfterViews() {
Adapter adapter = new Adapter();
list.setAdapter(adapter);
list.setOnItemClickListener(adapter);
TextView text = (TextView) footerView.findViewById(R.id.text);
text.setText("Test");
list.addFooterView(footerView);
}
I have no problem except slowing. Why ? How can I improve that ?
Thx in advance
Add it before setting adapter.
list.addFooterView(footerView);
And then
list.setAdapter(adapter);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With