title: OnActivityResult not working (Android)
body: <p>I am using a simple function OnActivityResult, but it is not returning me desired results.    </p>
  
  <p>Please see my code and tell me where i am doing wrong.    </p>
  
  <pre><code>public void OnClickFunction(View view)
  {
      Intent intent = new Intent(getApplicationContext(), Second.class);
      startActivityForResult(intent, RESULT_OK);
  
  ///     My actions. . . 
  }    
  </code></pre>
  
  <p>Then in the Second class, i have set Result like this:    </p>
  
  <pre><code>Button.setOnClickListener(new OnClickListener()
      {
          @Override
          public void onClick(View v)
          {
              ValueOne = EditText.getText().toString().trim();
              if (ValueOne.equals(String.valueOf(Answer)))
              {
                  Toast.makeText(getApplicationContext(), "Correct Answer", 0).show();
                  Second.this.setResult(RESULT_OK, null);
                  Second.this.finish();
              }
              else
              {
                  Toast.makeText(getApplicationContext(), "Wrong Answer", 0).show();
              }
          }
      });    
  </code></pre>
  
  <p>Now coming back to the first.class, from where the Intent was called:    </p>
  
  <pre><code>    @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data)
  {
      super.onActivityResult(requestCode, resultCode, data);
  //      if (requestCode == RESULT_OK)
  //      {
          if (resultCode == RESULT_OK)
          {
                               /////  MyActions. . . 
          }
  //      }
  }    
  </code></pre>
  
  <p>The debugger is not debugging this function, so the desired results are not coming.<br>
  Where i am doing wrong??</p>