I have simplified the problem for explain it easily: The initial layout of my test is:

And when I execute it (with only a setContentView call in the activity) it shows the following layout when I open the soft keyboard for the input:

but when I hide the keyboard its behaviour is a little buggy Lefting this image in the screen (a black rectangle in the slot where the surfaceview was):

Tried in the emulator with the same result.
How can I solve this problem? Thanks
Found the solution. It is a bug that can be solved with
theSurfaceView.setBackgroundColor(Color.Transparent);orandroid:background="#00000000"at the XML