Draw on Surfaceview on button press, how to setup everything?
<p>In my project I want to have a main class/activity that has a button on it's view, I should be able to press this button and that should start drawing something on the surfaceview. </p>

<p>Problem is I dont know how to set up everything. I tried to run the following in the onclick for my button but that did nothing. </p>

<pre><code>mySurfaceView.onResumeMySurfaceView();
</code></pre>

<p>The code above comes from these methods: Look at the example down at the bottom.</p>

<pre><code> @Override
 protected void onResume() {
  // TODO Auto-generated method stub
  super.onResume();
  mySurfaceView.onResumeMySurfaceView();
 }

 @Override
 protected void onPause() {
  // TODO Auto-generated method stub
  super.onPause();
  mySurfaceView.onPauseMySurfaceView();
 }
</code></pre>

<p>Take a look at this example below. In that example they set setContentView(mySurfaceView); in the onCreate method. I have set my other view with the button and some other elements.
So, I want the surfaceview to run when I press my button but I dont know how to set up it since I already have a View.</p>

<p>Example:
<a href="http://android-coding.blogspot.se/2011/05/drawing-on-surfaceview.html" rel="nofollow">http://android-coding.blogspot.se/2011/05/drawing-on-surfaceview.html</a></p>
