So far, I used the startActivity function with success and now that I need to use the startActivityResult, I have a problem.
When using this function, the activity
android:noHistory="true"
like
android:launchMode="singleInstance"
will stop onActivityResult from receive result.
There is bug in android API. In startActivityForResult(intent, requestCode); This funktion does work as long as requestCode = 0. However, if you change the request code to anything other than zero, the ApiDemos will fail (and OnActivityResult won't be called). Found here:
[EDIT: Link removed as google group overrun with spam]
In my case, I didn't realize I was calling startActivityForResult
from an activity that had the android:noHistory
attribute set to true in the manifest. Therefore, the onActivityResult
was never called as there was no activity instance anymore.
Did you add the setResult() call in your MoodPicker class ?
My silly mistake. Might help someone.
I kept onActivityResult(...) in another class. It has to be as a method in the class where the startActivityForResult() is called.
I had same problem and solved it: Just remove
android:launchMode="singleInstance"