How to get a list of installed android applications and pick one to run

后端 未结 19 1833
误落风尘
误落风尘 2020-11-21 06:26

I asked a similar question to this earlier this week but I\'m still not understanding how to get a list of all installed applications and then pick one to run.

I\'v

19条回答
  •  说谎
    说谎 (楼主)
    2020-11-21 07:11

    To get al installed apps you can use Package Manager..

        List apps = getPackageManager().getInstalledPackages(0);
    

    To run you can use package name

    Intent launchApp = getPackageManager().getLaunchIntentForPackage(“package name”)
    startActivity(launchApp);
    

    For more detail you can read this blog http://codebucket.co.in/android-get-list-of-all-installed-apps/

提交回复
热议问题