isAttachedToWindow() alternative for API level < 19
Asked Answered
H

1

8

I want to use the call videoView.isAttachedToWindow() within my fragment to verify if videoview is initialized fine and is ready to be called.

But this call requires api level 19 (current min is 14). What is the best alternative for videoView.isAttachedToWindow() for API level 14 and above?

EDIT: My videoview plays video streamed through HDMI input of Android boxes. In certain hardware that has OS 4.0.4, videoview sometimes jitter.

Hirohito answered 8/2, 2017 at 12:23 Comment(0)
T
30

ViewCompat.isAttachedToWindow() will do the trick up to API 4.

Trainor answered 8/2, 2017 at 12:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.