Fix NullPointerException in addHeaderViewToActivity (closes #246)