0
     Intent bookIntent = new Intent(this,ParseJson.class);
         // bookIntent.setClass(TitanGallery.this,ParseJson.class);
          startActivityForResult(bookIntent,BOOK_SELECT);


        protected void onActivityResult(int requestCode, int resultCode, Intent data) 
         {
          // TODO Auto-generated method stub
          super.onActivityResult(requestCode, resultCode, data);
          Toast.makeText(getApplicationContext(), "test", Toast.LENGTH_SHORT).show();
         }

称为活动

Bundle b  = new Bundle();
      b.putStringArrayList("str_array", values);
      Intent go_parent  = new Intent();
      go_parent.putExtras(b);
      setResult(RESULT_OK,go_parent);
      finish();

我有一个调用 startactivityforResult 的活动,并且该活动与数组捆绑在一起。子活动没有被调用。我为此提供了很多代码,但我没有得到我的错误在哪里。如果你学过的人可以调查一下吗?

4

1 回答 1

0

尝试这个...

protected void onActivityResult(int requestCode, int resultCode, Intent data)  {
  // TODO Auto-generated method stub
  if(requestCode == BOOK_SELECT && resultCode == RESULT_OK) {
  Toast.makeText(getApplicationContext(), "test", Toast.LENGTH_SHORT).show();
  }
}
于 2012-05-25T09:33:04.127 回答