标签:des android http color io ar java for sp
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/darker_gray" > <com.ada.MySurfaceView android:id="@+id/surfaceView" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </RelativeLayout >
public class CartoonActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub setContentView(R.layout.cartoon); //在这里进行相关运算,最后得到一值,想把这个值传到SurfaceView中, //并且SurfaceView构造时要用到这个值,怎么 实现啊????? } }
public class MySurfaceView extends SurfaceView implements Callback, Runnable { public MySurfaceView(Context context, AttributeSet attrs) { super(context, attrs); } @Override public void surfaceCreated(SurfaceHolder holder) { } @Override public boolean onKeyDown(int key, KeyEvent event) { return super.onKeyDown(key, event); } @Override public boolean onTouchEvent(MotionEvent event) { return true; } @Override public void run() { // TODO Auto-generated method stub } @Override public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { // TODO Auto-generated method stub } @Override public void surfaceDestroyed(SurfaceHolder holder) { // TODO Auto-generated method stub } }
标签:des android http color io ar java for sp
原文地址:http://www.cnblogs.com/lengyanyue39/p/4011164.html