代码在这里
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
LayoutInflater inflater = null;
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getContext());
if(resultCode == Activity.RESULT_CANCELED) return;
else if (resultCode == Activity.RESULT_OK)
inflater = getActivity().getLayoutInflater();
alertDialogBuilder
.setView(inflater.inflate(R.layout.dialog_result_request, null))
.setCancelable(true);
AlertDialog alertDialog = alertDialogBuilder.create();
alertDialog.show();
alertDialog.setContentView(R.layout.dialog_result_request);
alertDialog.getWindow().setWindowAnimations(R.style.PauseDialogAnimation);
}
答案 0 :(得分:0)
在您的onActivityResult
方法中添加代码,如下面的代码,并添加条件与您的结果代码匹配。
// Call Back method to get the Message form other Activity
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
super.onActivityResult(requestCode, resultCode, data);
// check if the request code is same as what is passed here it is 2
if(requestCode==2)
{
//Do your task here
}
}