• 检测手机中是否安装了google地图,没有则提示安装,并跳转到地图查找特定的地点



         /**
    * 检测手机中是否安装了某个特定的app,若没有提示安装 */ PackageInfo name_2 = null; try { // 若没有这个包名会异常 name_2 = getPackageManager().getPackageInfo( "com.google.android.apps.maps", 0); } catch (NameNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); File file = new File("/sdcard/google_map.apk"); // 打开特定位置的app提示安装 openFile(file); }
       /*
         * 通过路径打开特定的app安装包
         */
        private void openFile(File file) {
            // TODO Auto-generated method stub
            Intent intent = new Intent();
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            intent.setAction(android.content.Intent.ACTION_VIEW);
            intent.setDataAndType(Uri.fromFile(file),
                    "application/vnd.android.package-archive");
            startActivity(intent);
        }
         //跳转到地图,查找特定的位置
            String name_1 = "北店嘉园";
            Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
                    Uri.parse("geo:0,0?q=" + name_1));
            startActivity(intent);
  • 相关阅读:
    uap
    打印机驱动下载
    hsf
    系统安装
    npm
    webuploader传递参数
    thinkphp5集成H-ui后台(五)集成webUploader
    webUploader上传视频,包括上传进度、上传状态、暂停和取消等
    webuploader php上传视频
    使用Webuploader大文件分片传输
  • 原文地址:https://www.cnblogs.com/qinghuaideren/p/3252634.html
Copyright © 2020-2023  润新知