I\'m trying to modify the SurfaceView I use for doing a camera preview in order to display an overlaying square. However, the onDraw method of the extended SurfaceView is ne
Based on all above comments I used :
Add setWillNotDraw(false) in the onAttachedToWindow() event.
@Override protected void onAttachedToWindow() { super.onAttachedToWindow(); setWillNotDraw(false); }
and it worked.