It is necessary that when a button is clicked on a button, a window opens with a choice of the default application. For example, as in the screen number 3. enter image description here After the application has been selected by default by the user, you need to somehow check which application they have chosen, and if not our application was chosen, determine it.

PS In my case, it is necessary that the user select the default application for SMS.

How to achieve this? Please provide sample code.

  • one
    I found an interesting one on the same topic, added a link in reply - tse

1 answer 1

To determine the default application selected by the user, the PackageManager.resolveActivity () method should help you.

Starting from API 24, an application can get an ACTION_DEFAULT_SMS_PACKAGE_CHANGED intent that it has become or ceased to be the default SMS receiving application.