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 onActivityResult()
is immediately being triggered. The activity shows up but RESULT_CANCELED
is immediately returned to onActivityResult()
.
I then interact with the activity, press a button which calls finish()
, and onActivityResult()
is not called this time (because apparently a result has already been returned).
Does this make sense to anyone? Has anyone seen this behavior before?
singleTop
seems fine for me,singleTask
however was causing this issue and hencesingleInstance
would definitely do too – Abreaction