开发者

Oncreate()is called after setResult instead of OnActivityForResult() in 2.2.1 LG-P500

开发者 https://www.devze.com 2023-03-18 03:44 出处:网络
In my application I use the startActivityForResult() and get the result using SetResult (request code,data). It is working fine, but in LG devices the setResult() is not getting called directly. First

In my application I use the startActivityForResult() and get the result using SetResult (request code,data). It is working fine, but in LG devices the setResult() is not getting called directly. First it is calling the onCreate() and then calling the onActivitForResult()

Below is my code

FirstActivity Button Click event 

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

call the onactivity result of first activity in second activity using below code

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

                Deta开发者_运维技巧ils.this.finish();

Give me some suggestions for this.Thanks in advance


Please make sure u are not finishing the calling activity.......


it was crazy. I spend much for solving this issue and as result following fixed this issue:

turn off "Developer options" -> Apps -> "Don`t keep activities" option

0

精彩评论

暂无评论...
验证码 换一张
取 消