Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

isAttachedToWindow() alternative for API level < 19

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.

like image 984
jay Avatar asked Feb 08 '17 12:02

jay


1 Answers

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

like image 73
azizbekian Avatar answered Oct 08 '22 20:10

azizbekian