Way to know if my application is installed

前端 未结 2 1983
抹茶落季
抹茶落季 2021-01-16 20:43

Is there any way (intent) to know if my application is installed ? I followed the below link, but my application don\'t get the intent when my app is installed

Andro

2条回答
  •  深忆病人
    2021-01-16 21:28

    You can use http://developer.android.com/reference/android/content/pm/PackageManager.html#getInstalledPackages(int)

    Remember to set the appropriate permission in your AndroidManifest.

    You quoted the link to Android - How to intercept the 'Install application' intent - which would mean you like to know when you application was installed at all? Are you trying to check if people actually download your app? Basically I think it's not possible to do that.

    But if you like to see if your app was installed, just check for a SharedPreference and if not possible, it's a fresh install.

提交回复
热议问题