IAB, onActivityResult() and the strange message "startActivity called from non-Activity context" <p>I am using OpenIAB to support in app purchasing in my app (OpenIAB uses google code to implement IAP for Google Play Store). The problem is that, sometimes, when i call launchPurchaseFlow(), the method onActivityResult() of my FragmentActivity is not called. Checking the logs, i have found that when this happens there is always the following msg:</p> <blockquote> <p>W/ActivityManager( 319): startActivity called from non-Activity context: forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { cmp=com.android.vending/com.google.android.finsky.billing.lightpurchase.IabV3Activity (has extras) }</p> </blockquote> <p>When this happens, i have to close the app. Usually it start working again after some time (i have absolutely no clue of why is it so). I don't know why this message show up, since the context is obviously my activity (and in fact it works most of time). I have to say that the .apk installed on my device is an updated verion with respect to the apk uploaded in the beta version of the developer console and that i am using my google developer account to test IAP. This implies that i cannot make any real buy. However, this is not important, since i am testing the app. These are my questions: </p> <ol> <li>Is it true that starting an activity for result with FLAG_ACTIVITY_NEW_TASK prevents onActivityResult() to be called?</li> <li>How do you explain that message?</li> </ol> <p>Regarding the first question, i have tested with launchMode=singleTask and the behaviour is the same of launchMode=singleTop.</p>