How to get the package name of the app running in android

Viewed 6286

I want to know how to get the package name when I open an app, for instance when I open Facebook I should get its package name and when I open another app I should get its package name how do I do this?

3 Answers
Related