“失败的交付结果”-onActivityForResult
我有一个LoginActivity(用户登录)。基本上,它自己Activity的主题类似于对话框(看起来就像对话框一样)。它出现在上方SherlockFragmentActivity。我想要的是:如果成功登录,则应该有两个FragmentTransaction来更新视图。这是代码: 在中LoginActivity,如果成功登录, setResult(1, new Intent()); 在SherlockFragmentActivity: @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == 1) { LoggedStatus = PrefActivity.getUserLoggedInStatus(this); FragmentTransaction t = MainFragmentActivity.this.getSupportFragmentManager().beginTransaction(); SherlockListFragment mFrag = new MasterFragment(); t.replace(R.id.menu_frame, mFrag); t.commit(); // Set up Main Screen FragmentTransaction t2 = MainFragmentActivity.this.getSupportFragmentManager().beginTransaction(); SherlockListFragment mainFrag …