android - adding a linear layout defined in xml at the footer of listview -


i trying add linear layout defined in xml @ footer of listview. tried below code

listview.addfooter(findviewbyid(r.id.my_linearlayout)) 

but throwing error

java.lang.nullpointerexception: attempt invoke virtual method 'android.view.viewgroup$layoutparams android.view.view.getlayoutparams()' on null object reference 

if remove addfooter code acitvity runs smoothly.can 1 please suggest issue or if right way add linearlayout @ footer of listview dynamically. in advance.

view footerview = getlayoutinflater().inflate(r.layout.my_linearlayout, null); listview.addfooterview(footerview);

you should add my_linearlayout /res/layout/ folder.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -