Trigger broadcast receiver only if my activity is in memory, else it should not get triggered, how to do it?

Answer: Register a dynamic receiver in that Activity.

Description: If you want to trigger broadcast receiver as long as activity is in memory, then go for dynamic receiver which gets registered only when activity comes into memory. and unregister it before killing your activity.

No comments:

Post a Comment