Search code examples
androidservicesystemeventlistener

How to run my app in background and listen to a hyperlink click event in from other apps or browsers


User installs my app. Once installed, it runs in the background forever unless user disables the run forever button in my app or uninstalls my app. Now, my app need to show a popup message once a hyperlink click event is triggered from anywhere in the android device. The click event might have been triggered from default messaging apps (like user click a link provided in a message he/she has received) or from some other apps in the device like twitter and facebook.

I want to know if there is any way I could achieve this? If yes, then please suggest me how to do it. Any kind of help will be greatly appreciated.

Thanks!


Solution

  • The correct way to do this is with Intent Filter, not by having your app run constantly in the background.

    Android Respond To URL in Intent

    Then, you can program whatever behavior you would like to happen