Android-PackageManager


PackageManager

Class for retrieving various kinds of information related to the application packages that are currently installed on the device. You can find this class through Context#getPackageManager.

PackageManager 负责管理应用程序安装、卸载和升级的API。

getLaunchIntentForPackage

abstract fun getLaunchIntentForPackage(packageName: String): Intent?

Returns a “good” intent to launch a front-door activity in a package. This is used, for example, to implement an “open” button when browsing through packages. The current implementation looks first for a main activity in the category Intent#CATEGORY_INFO, and next for a main activity in the category Intent#CATEGORY_LAUNCHER. Returns null if neither are found.

负责获得应用程序Launch的Intent。

返回一个“包”中的入口Activity的Intent,例如,这个类似于在浏览包的“打开”按钮。这个当前的安装启动第一步在category(CATEGORY_INFO)中寻找main Activity,然后category(CATEGORY_LAUNCHER)寻找main Activity。如果找不到返回 null。

引用:

PackageManager

APK安装流程详解2——PackageManager简介


文章作者: TheCara
版权声明: 本博客所有文章除特別声明外,均采用 CC BY-NC 4.0 许可协议。转载请注明来源 TheCara !
 上一篇
Android PendingIntent Android PendingIntent
PendingIntent 描述 A description of an Intent and target action to perform with it. Instances of this class are created wi
2020-12-07
下一篇 
Android Docs Android Docs
android.support.v4.media.session.MediaControllerCompat 类 属于 media.session 包下。 允许应用与正在进行的媒体会话进行互动。 方法名 参数 描述 返回值 g
2020-12-02
  目录