onActivityResult not getting result
<p>I simply want to return the string with intent from a another activity but not getting that string in parent activity...though no error is shown.
for test purpose just want to show toast message on return of result..</p>

<p>here's the code of parent activity....</p>

<pre><code>public class Login2 extends Activity {
     static final int REQ_CODE=0;
 /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.login);

      Button startButton=(Button) findViewById(R.id.btn_login);
        startButton.setOnClickListener(new View.OnClickListener()
        {
         public void onClick(View view)
         {          
          final TextView var=(TextView)findViewById(R.id.errmsg);

          EditText usrnameobj = (EditText)findViewById(R.id.et_usename);
          EditText usrpassobj = (EditText)findViewById(R.id.et_password); 
          String username = usrnameobj.getText().toString(); 
          String password = usrpassobj.getText().toString(); 

          Intent i=new Intent(getApplicationContext(),AndroidXmlResource.class);
          i.putExtra("entry",username.toString() + password.toString());
          startActivityForResult(i,REQ_CODE);
         }  
         protected void onActivityResult(int requestCode, int resultCode, Intent data)

            {

          //if (resultCode == Activity.RESULT_OK &amp;&amp; requestCode == 0) 
           {

                      //String res = data.getExtras().getString("result");
                     // TextView var=(TextView)findViewById(R.id.errmsg);
                     // var.setVisibility(0);
                     // var.setText(res.toString());
                     // var.setText("called on act res");

                      Toast.makeText(Login2.this,"Hi! Bright Hub", Toast.LENGTH_SHORT).show();
                  }
            }
        });   
</code></pre>

<p>And here's the child activity that returns a result....</p>

<pre><code>public class AndroidXmlResource extends Activity {

 //public String U="sudeep1";
 //public String P="donotlock1";
 public int Res;
 @Override
 protected void onCreate(Bundle bundle) {
  // TODO Auto-generated method stub
  super.onCreate(bundle);
  //setContentView(R.layout.main);
  Bundle extras = getIntent().getExtras();
  if (extras == null) {
   return;
  }
  String pass=extras.getString("entry");
  //String result= new String();
        //TextView myXmlContent = (TextView)findViewById(R.id.tv_test);

  try {
   String stringXmlContent = getEventsFromAnXML(this);
   //myXmlContent.setText(pass.toString());
   Intent returnIntent = new Intent();
   if(stringXmlContent.equals(pass))
   {

    returnIntent.putExtra("result","valid Login");
    setResult(RESULT_OK,returnIntent);   
       super.finish();

   }
   else
   {
    returnIntent.putExtra("result","Invalid Login");
       setResult(RESULT_OK,returnIntent);   
       super.finish();

   }


  } catch (XmlPullParserException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  } catch (IOException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }
    }

    private String getEventsFromAnXML(Activity activity)
    throws XmlPullParserException, IOException
    {

     StringBuffer stringBuffer = new StringBuffer();
     Resources res = activity.getResources();
     XmlResourceParser xpp = res.getXml(R.xml.myxml);
     xpp.next();
     int eventType = xpp.getEventType();
     while (eventType != XmlPullParser.END_DOCUMENT)
     {
      int c=1;
      if(eventType == XmlPullParser.START_DOCUMENT)
      {
       //stringBuffer.append("--- Start XML ---");
      }
      else if(eventType == XmlPullParser.START_TAG)
      {
       //stringBuffer.append("\nSTART_TAG: "+xpp.getName());

      }
      else if(eventType == XmlPullParser.END_TAG)
      {
       //stringBuffer.append("\nEND_TAG: "+xpp.getName());
      }
      else if(eventType == XmlPullParser.TEXT)
      {
       //stringBuffer.append("\nTEXT: "+xpp.getText());
       //extra

       { String t=xpp.getText().toString();

         stringBuffer.append(t.toString());      

       }       
      }

      eventType = xpp.next();
     }
     //stringBuffer.append("\n--- End XML ---");
     return stringBuffer.toString();
</code></pre>
