title: Passing data though multiple activities
body: <p>1- is my first activity(main)
  2- is my second activity
  3 - is my third activity</p>
  
  <p>I want to run 2 from 1 and then form 2 run 3 , and then from 3 i am taking data and returning it to 1. Hope guys you will understand.</p>
  
  <p>Here is my code:</p>
  
  <p>Runing 2 form 1 liek this :</p>
  
  <pre><code>            Intent intent = new Intent(getApplicationContext(),MessageBox.class);
               intent.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
              startActivityForResult(intent,5);               
  </code></pre>
  
  <p>And then running 3 from 2 like this:</p>
  
  <pre><code>                Intent intent = new Intent(getApplicationContext(),ImageReceiver.class);
  
                  startActivityForResult(intent,5);
  </code></pre>
  
  <p>And then in 3 i have something like this:</p>
  
  <pre><code>          setResult(10);
            finish();
  </code></pre>
  
  <p>So i set result so in 2 to get this result i have:</p>
  
  <pre><code>        if(requestCode==5)
          {
              if(resultCode==10)
              {
  
                  Intent intent = new Intent(getApplicationContext(),MainActivity.class);
  
                  setResult(5,intent);
                  finish();
              }
          }
  </code></pre>
  
  <p>And then in 1 i got:</p>
  
  <pre><code>     if(requestCode==5)
       {
           if(resultCode==5)
           {
               //here i am taking data from 3
           }
       }
  </code></pre>
  
  <p>Problem is i cant even open 2 coz in logcat i am getting:</p>
  
  <p>04-23 22:13:15.579: E/AndroidRuntime(15313): android.util.AndroidRuntimeException: FORWARD_RESULT_FLAG used while also requesting a result</p>
  
  <p>And i dont really get what should i do. Please look at this code.</p>