I know i am too late to the party, but now you can directly use this API of ViewCompat to set the view as header.
ViewCompat
ViewCompat.setAccessibilityHeading(view, true)