Back to project page Canvas-Test.
The source code is released under:
Apache License
If you think the Android project Canvas-Test listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package foobar.canvastest; /* w w w . j a v a 2 s.com*/ import android.app.Activity; import android.os.Bundle; import android.view.ViewGroup; import foobar.canvastest.drawing.scenes.ExampleScene; /** * This is the main "Activity", the Android equivalent of a page or form. * * Its UI corresponds to what is given in res/layout/main.xml * One of the elements, the actual MySurfaceView we draw on, is created * programatically as opposed to being in the xml. This is because it is a * custom class without any XML binding */ public class MainCanvasActivity extends Activity { MySurfaceView mSurfaceView; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ViewGroup containerView = (ViewGroup)findViewById(R.id.containerView); mSurfaceView = new MySurfaceView(this, new ExampleScene()); containerView.addView(mSurfaceView); } }