Question: How do I get the actual Activity **instance** of the top current activity of a running Andoind application?

Reason: I receive a OnMessageReceived Data payload from Firebase while my application is running in the foreground, and I need to finish() it.

Note: there are tons of other info to get the ComponentName using getRunningTasks() or getAppTasks(), but all these does not seem to provide any way to get the actual Activity instance.

Answer: 
The better way would be to use a `Local Broad Cast` to inform your activity to finish itself.  

You just need to register a Broad Cast Receiver inside your activity and then send the broadcast in your FCM Messaging Service. Check [this page](https://developer.android.com/reference/android/support/v4/content/LocalBroadcastManager.html) on how to do this.

**Note:** Make sure to unregister the receiver when you're done with the activity.
You can also use EventBus for the Same