package jp.Eclipse; import android.os.Bundle; import android.os.Handler; import android.app.Activity; import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.widget.LinearLayout; public class MainActivity extends Activity implements Runnable { final static int CELLSIZE=2; // セルのサイズ final static int DELAY=1000; // 遅延時間 final static int NUMCELL=199;// 縦・横のセルの数(配列の大きさは+2) public int [][][] A =new int[2][NUMCELL+2][NUMCELL+2]; public int MD=4; // 法 public int curP=0; // 現在の配列 public sView lv; // 表示用View public Paint[] paint; // ペイント用 public Handler hn; // ハンドル @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); requestWindowFeature(Window.FEATURE_NO_TITLE); LinearLayout LL=new LinearLayout(this); setContentView(LL); lv=new sView(this); LL.addView(lv); initialize(); hn =new Handler(); hn.postDelayed(this,DELAY); } @Override public void run() { lv.invalidate(); hn.postDelayed(this, DELAY); } public void onDestroy(){ super.onDestroy(); hn.removeCallbacks(this); } public void initialize(){//初期設定 paint=new Paint[MD]; int [] cl={0xFF000080, 0xFFFF0000,0xFF00FF00,0xFFFFFF00}; for(int i=0;i