How to prompt user to update the Application, and when the user clicks on update it should update in background

Follow This Link and as shown in picture enter image description here

Its a new PlayStore feature introduced in I/O 2019


The Play Store handles the update dialog when a new update is pushed to the store. Just ensure you update the APK with a higher version code. Happily there is no need for you to inform the user manually.

see: How to put an update notification for your android app then the users will be directed to Google Playstore?

https://stackoverflow.com/a/9878292/7767143