import java.util.*;
import android.app.*;
import android.content.*;
import android.graphics.*;
import android.os.*;
import android.view.*;
public class RenderViewTest extends Activity
{
class RenderView extends View
{
Random rand = new Random();
public RenderView(Context context)
{
super(context);
}
protected void onDraw(Canvas canvas)
{
canvas.drawRGB(rand.nextInt(256),
rand.nextInt(256),
rand.nextInt(256));
invalidate();
}
}
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(new RenderView(this));
}
}
import android.app.*;
import android.content.*;
import android.graphics.*;
import android.os.*;
import android.view.*;
public class RenderViewTest extends Activity
{
class RenderView extends View
{
Random rand = new Random();
public RenderView(Context context)
{
super(context);
}
protected void onDraw(Canvas canvas)
{
canvas.drawRGB(rand.nextInt(256),
rand.nextInt(256),
rand.nextInt(256));
invalidate();
}
}
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(new RenderView(this));
}
}
'코드조각모음' 카테고리의 다른 글
[android013] 비트맵 그리기 (0) | 2011.11.06 |
---|---|
[android012] 캔바스 예제 - 도형 그리기 (0) | 2011.11.06 |
[android010] 전체화면 예제 (0) | 2011.11.06 |
[android009] 배경음을 위한 MediaPlayer 예제 (1) | 2011.11.06 |
[android008] 효과음을 위한 SoundPool 예제 (0) | 2011.11.06 |