gpt4 book ai didi

android - 在 2.2.1 LG-P500 中,在 setResult 之后调用 Oncreate() 而不是 OnActivityForResult()

转载 作者:行者123 更新时间:2023-11-29 02:12:19 25 4
gpt4 key购买 nike

在我的应用程序中,我使用 startActivityForResult() 并使用 SetResult(请求代码、数据)获取结果。它工作正常,但在 LG 设备中,setResult() 没有被直接调用。首先它调用 onCreate() 然后调用 onActivitForResult()

下面是我的代码

FirstActivity Button Click event 

startActivityForResult(new Intent(TestActivity.this, Details.class),1);

使用以下代码在第二个 Activity 中调用第一个 Activity 的 Activity 结果

Intent data=new Intent();
data.putExtra("TEST", true);
setResult(2, data);

Details.this.finish();

为此请给我一些建议。提前致谢

最佳答案

请确保您没有完成通话 Activity ......

关于android - 在 2.2.1 LG-P500 中,在 setResult 之后调用 Oncreate() 而不是 OnActivityForResult(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6595013/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com