How to detect if another app is opened

Please I need help on how to detect if another app is opened/running
For e.g, if youtube app is opened.
please a little recommendation could be helpful.

1 Like

Please elaborate more…
What do you mean by opened here…?
You want to detect is youTube app open by your app
Or what?

Yes i want to detect if youtube app is opened?

You would like to use PkgUtils extension.

1 Like

Yes this can only possible with background task extension