a activity namelayout.setOnClickListener(new OnClickListener() { @Override
public void onClick(View v) {
Intent intent = new Intent(EditAccount.this,
CustomInfoEdit.class);
Bundle bundle = new Bundle();
// bundle.putString("type", "egamename");
intent.putExtras(bundle);
startActivityForResult(intent,0); }
}); @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub\
Log.v("test", "------------------------------>");
super.onActivityResult(requestCode, resultCode, data);
}
b activity Intent intent = getIntent();
Bundle bundle = intent.getExtras();
// bundle.putString("type", type);
// intent.setClass(CustomInfoEdit.this, EditAccount.class);
bundle.putString("value", edit.getEditableText().toString());
intent.putExtras(bundle);
setResult(RESULT_FIRST_USER, intent);
finish();

解决方案 »

  1.   

    setResult(RESULT_FIRST_USER, intent);
    改成
    setResult(RESULT_OK, intent);    //RESULT_OK=-1;就OK了
      

  2.   

    没用的,本来是result_ok的. 换成其他的试试的
      

  3.   

    那调试了吗 设断点看看 有时Logcat会挂出不了信息的
      

  4.   

    Intent intent = getIntent();
                    Bundle bundle = intent.getExtras();
    上面部分是获取A传递过来的数据! 
    下面部分是想返回数据的!需要重新构造Intent
                    Intent intent1=new Intent();
                    Bundle bundle1=new Bundle();
                    bundle1.putString("value", edit.getEditableText().toString());
                    intent1.putExtras(bundle1);
                    setResult(RESULT_FIRST_USER, intent1);楼主试试吧!
                    finish();
      

  5.   

    问题是,它根本不走onActivityResult这个方法
      

  6.   


    请问正常情况下,可能是何种原因导致的呢?   自己写的demo也可以实现没问题
      

  7.   

    在b activity 中打印他的calling activity也是空
      

  8.   

    PS: 是类似于tab的页面。getParent的也不好使
      

  9.   

              Intent intent = getIntent();
                    Bundle bundle = intent.getExtras();
    //                bundle.putString("type", type);
    //                intent.setClass(CustomInfoEdit.this, EditAccount.class);
                    bundle.putString("value", edit.getEditableText().toString());
                    intent.putExtras(bundle);
                    EditAccount.this                finish();哥,你这个intent是什么,getIntent()???
     Intent intent2=new Intent( CustomInfoEdit.this,EditAccount.class);
     setResult(RESULT_FIRST_USER, intent2);
     这样就行了 
      

  10.   

    自己上网查下forResult怎么用的?看你还是个新手,慢慢学吧
      

  11.   

    结贴。因为结果都返回至a activity的上一层activitygroup那边去了。被楼上的雷死了。最TMD烦这种不看清问题的回帖。
      

  12.   

    this.getParent().setResult(RESULT_OK, intent);//重点是this.getparent()