Fix NullPointerException in addHeaderViewToActivity (closes #246)

Fix a NullPointerException.