Esempio n. 1
0
 @Override
 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
   LogCat.i("--->", "requestCode:" + requestCode + " Result ok?:" + resultCode);
   super.onActivityResult(requestCode, resultCode, data);
   if (mPublishFragment != null && mPublishFragment.isMyRequest(requestCode)) {
     LogCat.i("--->", "mPublishFragment->onActivityResult");
     mPublishFragment.onActivityResult(requestCode, resultCode, data);
   } else if (requestCode == LoginDialog.REQUEST_CODE && resultCode == RESULT_OK) {
     if (mCenterFragment == null) {
       mCenterFragment = new CenterFragment();
     }
     changeFrag(mCenterFragment, mCurFragment);
     centerrb.setChecked(true);
   } else if (requestCode == BaseFragment.TO_SCAN) {
     if (!mMainFramgent.isHidden()) {
       mMainFramgent.onActivityResult(requestCode, resultCode, data);
     } else if (!mFindFrament.isHidden()) {
       mFindFrament.onActivityResult(requestCode, resultCode, data);
     }
   }
 }
Esempio n. 2
0
  @Override
  public void onCheckedChanged(RadioGroup group, int checkedId) {

    switch (checkedId) {
      case R.id.main_rb:
        {
          if (mMainFramgent == null) {
            mMainFramgent = HomeFragment.newInstance(null, null);
          }
          changeFrag(mMainFramgent, mCurFragment);

          break;
        }
      case R.id.find_rb:
        {
          if (mFindFrament == null) {
            mFindFrament = FindFragment.newInstance(null, null);
          }
          changeFrag(mFindFrament, mCurFragment);
          break;
        }
      case R.id.publish_rb:
        {
          if (mPublishFragment == null) {
            mPublishFragment = PublishFragment.newInstance(null, null);
            mPublishFragment.setCallback(this);
          }
          changeFrag(mPublishFragment, mCurFragment);
          break;
        }
      case R.id.center_rb:
        {
          if (mCenterFragment == null) {
            mCenterFragment = CenterFragment.newInstance(null, null);
          }

          changeFrag(mCenterFragment, mCurFragment);

          break;
        }
      default:
        {
          break;
        }
    }
  }