Wenzhe Wenzhe - 19 days ago 7
Android Question

Talkback with ExploreByTouchHelper doesn't show green square on SurfaceView inside dynamic loaded Fragment

I have a dynamic loaded fragment inside the activity. The fragment contains one SurfaceView in the bottom and it contains some text image. I used ExploreByTouchHelper for Talkback. It can read the context but can't draw the green square on SurfaceView. But if the activity contains some components(like buttons) below this SurfaceView then the green square can be drawn.
So it seems that the Application doesn't know that the space on screen for SurfaceView belongs to this Application. If some components added below, only then it knows that itself owns that space.
So anything I can do to get this green square back?
Many thanks.

Answer

It seems that SurfaceView by default will not enable drawing on it's surface so the talkback can't draw on it's surface. To enable this you have to call setWillNotDraw(false).

Comments