Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.graphics.Canvas;
import android.graphics.Color;

import android.graphics.PorterDuff;
import android.graphics.Rect;

import android.view.SurfaceHolder;
import android.view.SurfaceView;

public class Main {
    public static synchronized void cleansurfaceview(SurfaceHolder postureholder, SurfaceView posturesurface) {
        Canvas canvas = postureholder
                .lockCanvas(new Rect(0, 0, posturesurface.getWidth(), posturesurface.getHeight()));
        canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
        postureholder.unlockCanvasAndPost(canvas);
        Canvas canvasa = postureholder
                .lockCanvas(new Rect(0, 0, posturesurface.getWidth(), posturesurface.getHeight()));
        canvasa.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
        postureholder.unlockCanvasAndPost(canvasa);
    }
}