Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
812 views
in Technique[技术] by (71.8m points)

android - When I return back to my Activity onCreate is raised instead of onActivityResult?

I have an Activity that opens a new Activity for result like this:

Intent i = new Intent(ActDocument.this, ActCustomers.class);
startActivityForResult(i, ActDocument.DIALOG_CUSTOMER);

when I press back in the child Activity and return back to the parent Activity onActivityResult is called in all of devices correctly but I have fount a device that onCreate is called instead of onActivityResult.

This device is Samsung Galaxy Tab-P5100 Android 4.0.3. It is strange that I have tested my application on other devices of Samsung Galaxy Tab-P5100 Android 4.0.3 and it was OK but I have problem only in this device.

Why? How can I solve that?

Update

I noticed onDestroy() of parent Activity is called after opening child Activity on this device.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

most of the time Back button will finish the activity unless you specific override the

OnBackPressed()

I think your problem is lack of resources, or maybe you have some developer options like kill activty flag or limit background process check this.

Update

Go to setting-> developer options unchecked don't keep activities and background process limit set to standard limit.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...