相关疑难解决方法(0)

从Android上的其他应用程序启动应用程序

我想从我的Android应用程序中启动已安装的软件包.我假设有可能使用意图,但我找不到这样做的方法.有链接,在哪里可以找到信息?

android android-intent

458
推荐指数
11
解决办法
37万
查看次数

如果不存在,如何以编程方式下载adobe reader

现在我正在开发一个应用程序.通过我的应用程序用户可以阅读pdf文件,如果没有pdf阅读器,那么我的应用程序将自动从网站安装它.这是我用来阅读pdf文件的代码.

File file = new File("/sdcard/sample.pdf");
PackageManager packageManager = getPackageManager();
Intent testIntent = new Intent(Intent.ACTION_VIEW);
testIntent.setType("application/pdf");
List list = packageManager.queryIntentActivities(testIntent, PackageManager.MATCH_DEFAULT_ONLY);
if (list.size() > 0 && file.isFile()) {
    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_VIEW);
    Uri uri = Uri.fromFile(file);
    intent.setDataAndType(uri, "application/pdf");
    startActivity(intent);
}
Run Code Online (Sandbox Code Playgroud)

我的怀疑是:

  1. 如何检查手机中是否安装了adobe reader?
  2. 如何以编程方式在手机上安装Adobe阅读器?

android

6
推荐指数
1
解决办法
3512
查看次数

标签 统计

android ×2

android-intent ×1