On Activity result not called and getting error source not found
<p>I have started with the android application development and i facing issue hope i can find solution here:-</p>

<p>I have 2 activity A &amp; B , A calls activity B. In B a table is displayed and on click i want to navigate to activity A and pass the selection made by user in activity B. </p>

<p>here is the code i am using
in Activity A:-</p>

<pre><code>     /** listner for playlist button click*/
     btnPlaylist.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View arg0) {
                Intent i = new Intent(MainActivity.this, PlayListActivity.class);
                finish( );
                startActivity(i);
            } 
</code></pre>

<p>Using this i succesfully navigate to activity B.</p>

<p>In activity B i have itemclicklistener on which i navigate to activity A:-</p>

<pre><code>  private OnItemClickListener musicgridlistener = new OnItemClickListener() 
      {
            public void onItemClick(AdapterView parent, View v, int position,long id) 
            {


                        /** After selecting song go back to main view. */
                        Intent in = new Intent(PlayListActivity.this, MainActivity.class);
                        in.putExtra( "filename" , filename );
                        finish( );
                        startActivityForResult( in,0 );


            }
      };
</code></pre>

<p>On Activity A i have onActivityResult to get the result from B:-</p>

<pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) 
   {
      super.onActivityResult(requestCode, resultCode, data);

     if (requestCode == 0) { 


      }

}
</code></pre>

<p><strong>My Issues:-</strong></p>

<p>*<strong><em>When i run normally ( not in debugging mode) i navigate successfully navigate A->B->A.
but i don't get any result in A</em>*</strong> </p>

<p><strong>When i run in debug mode in emulator the OnActivityResult never gets called instead i get a
error 'Source not found' after below code is executed:-</strong></p>

<pre><code>                Intent in = new Intent(PlayListActivity.this, MainActivity.class);
                in.putExtra( "filename" , filename );
                finish( );
                startActivityForResult( in,0 );               
</code></pre>

<p>Thanks in advance,
Vishesh.</p>
