Can i pass uri value from onActivityResult() to onClick()?
<pre><code>public void onCreate(Bundle savedInstanceState)
{
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  mSurfaceView01 = (SurfaceView) findViewById(R.id.mSurfaceView1); 
  mSurfaceHolder01 = mSurfaceView01.getHolder();
  mSurfaceHolder01.addCallback(EX10_04.this);

  mButton02 = (Button)findViewById(R.id.buttonObj);
  mButton02.setOnClickListener( new Button.OnClickListener(){
    public void onClick(View arg0) {
        Intent intent = new Intent( Intent.ACTION_GET_CONTENT );
        intent.setType("audio/*");          
        Intent destIntent = Intent.createChooser( intent, "select audio" ); //pick up an audio file
        startActivityForResult( destIntent, 0 );
    }
  });
 }

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);

if ( resultCode == RESULT_OK )
{

    Uri uri = data.getData();
    if( uri != null )
    {  
      DrawO();//It will draw a circle
    }
    else
    {
      e.printStackTrace();
    }
}
</code></pre>

<p>The circle not show.....
but when i put the DrawO() next to</p>

<pre><code>  mSurfaceHolder01.addCallback(EX10_04.this);
</code></pre>

<p>It draw a circle !</p>

<p>if i want to draw a circle in the onActivityResult event</p>

<p>what shuld i do ?</p>

<p>or if i can pass uri to onClick function ?</p>

<pre><code>public void DrawO()
{

Canvas mCanvas01 = mSurfaceHolder01.lockCanvas(null);
mCanvas01.drawColor(getResources().getColor(R.drawable.white)); 
Paint mPaint01 = new Paint();
mPaint01.setStyle(Paint.Style.FILL);
mPaint01.setColor(getResources().getColor(R.drawable.red));
mPaint01.setStrokeWidth(1.0F);
........
.......
}
</code></pre>
