public static void takeSnapshot(){
  mSnapshotSurface.setZOrderOnTop(true);
  mSnapshotLayout.addView(mSnapshotSurface);
}

public static void takeSnapshot ( ) { mSnapshotSurface . setZOrderOnTop ( true ) ; mSnapshotLayout . addView ( mSnapshotSurface ) ; }
this method is called from stlfile or gcodefile when data is ready to render . add the view to the layout .
