TomBomb TomBomb - 1 year ago 168
Android Question

Android - startActivityForResult immediately triggering onActivityResult

I am launching activities from the main activity in my app using the call

startActivityForResult(intent, ACTIVITY_TYPE)
, and they are all working but one.

This one, when called, launches the activity as desired, but in the log I can see that
is immediately being triggered. The activity shows up but
is immediately returned to

I then interact with the activity, press a button which calls
, and
is not called the time (because apparently a result has already been returned).

Does this make sense to anyone? Has anyone seen this behavior before?

Answer Source

You can't use startActivityForResult() if your activity is being launched as a singleInstance or singleTop.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download