Fragment内跳转activity,不能onActivityResult回调问题解决方案:
第一 首先,继承AppCompatActivity
public class IndexActivity extends AppCompatActivity {
第二 在fragment内跳转activity
Postcard postcard= ARouter.getInstance().build(RouterPath.VerifyComfirmActivity)
.withString("title",name)
.withString("username",username)
.withParcelableArrayList("list",(ArrayList)months);
LogisticsCenter.completion(postcard);
Intent intent =new Intent(mContext,postcard.getDestination());
intent.putExtras(postcard.getExtras());
((AppCompatActivity)mContext).startActivityFromFragment(this,intent,2);
第三,在fragment内直接使用onActivityResult,因为AppCompatActivity继承了FragmentActivity;FragmentActivity调用了fragment的onActivityResult方法
public void onActivityResult(int requestCode,int resultCode, Intent data) {