Reputation: 5593
I have an application that uses SurfaceView
do draw content. I wanted to add nice ShowcaseView library to my application which uses getWindow().getDecorView()).addView(...)
to draw itself on top of other views and decorations. But in my case it does not draw over my SurfaceView
(if I remove it from layout, everything works perfect).
Is it a limitation of Android architecture, or I can tune something in my SurfaceView
or fix something in ShowcaseView library?
Update
If I call mySurfaceView.setVisibility(View.INVISIBLE)
just before creating ShowcaseView
everything works perfect too (except that my main view area is black).
Update 2
I've read about Z-indexes of SurfaceView
in documentation. I do not touch them in my code.
Upvotes: 2
Views: 1055
Reputation: 45942
SOLUTION
Add setWillNotDraw(false)
after calling the super constructor of your SurfaceView.
Other hints regarding surfaceview
It might be helpful to
getWindow().getDecorView()).requestTransparentRegion(mySurfaceView);
after making your view visibleUpvotes: 4