How can I differentiate an android Activity from a SubActivity programmatically? Is there any API for that?
I am assuming you are referring to detecting whether an activity was started via startActivityForResult()
or not.
In that case, try getCallingActivity()
. To quote the documentation, "Note: if the calling activity is not expecting a result (that is it did not use the startActivityForResult(Intent, int)
form that includes a request code), then the calling package will be null."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With