onActivityResult method not being called Android

前端 未结 9 1718
误落风尘
误落风尘 2020-12-08 07:58

I am trying to send data from child activity to parent. But somehow, onActivityResult(..) is not getting called. here is code

Parent activity

selecte         


        
9条回答
  •  自闭症患者
    2020-12-08 08:14

    onPause was effecting onActivityResult.

    One of the corner case might be:
    my case was different and silly: The problem was in onPause, finish called and end the activity. Removed that and works well.

    @Override
    protected void onPause() {
        super.onPause();
        finish(); // this line causing the issue removed it. 
    }
    

提交回复
热议问题