<tfoot id='DQNQQ'></tfoot>

    <i id='DQNQQ'><tr id='DQNQQ'><dt id='DQNQQ'><q id='DQNQQ'><span id='DQNQQ'><b id='DQNQQ'><form id='DQNQQ'><ins id='DQNQQ'></ins><ul id='DQNQQ'></ul><sub id='DQNQQ'></sub></form><legend id='DQNQQ'></legend><bdo id='DQNQQ'><pre id='DQNQQ'><center id='DQNQQ'></center></pre></bdo></b><th id='DQNQQ'></th></span></q></dt></tr></i><div id='DQNQQ'><tfoot id='DQNQQ'></tfoot><dl id='DQNQQ'><fieldset id='DQNQQ'></fieldset></dl></div>

    <legend id='DQNQQ'><style id='DQNQQ'><dir id='DQNQQ'><q id='DQNQQ'></q></dir></style></legend>

        <small id='DQNQQ'></small><noframes id='DQNQQ'>

          <bdo id='DQNQQ'></bdo><ul id='DQNQQ'></ul>

        禁止谷歌地图意图选择对话框

        时间:2023-08-30

                <tbody id='HUaQK'></tbody>

              <small id='HUaQK'></small><noframes id='HUaQK'>

              • <tfoot id='HUaQK'></tfoot>

              • <legend id='HUaQK'><style id='HUaQK'><dir id='HUaQK'><q id='HUaQK'></q></dir></style></legend>

                <i id='HUaQK'><tr id='HUaQK'><dt id='HUaQK'><q id='HUaQK'><span id='HUaQK'><b id='HUaQK'><form id='HUaQK'><ins id='HUaQK'></ins><ul id='HUaQK'></ul><sub id='HUaQK'></sub></form><legend id='HUaQK'></legend><bdo id='HUaQK'><pre id='HUaQK'><center id='HUaQK'></center></pre></bdo></b><th id='HUaQK'></th></span></q></dt></tr></i><div id='HUaQK'><tfoot id='HUaQK'></tfoot><dl id='HUaQK'><fieldset id='HUaQK'></fieldset></dl></div>
                  <bdo id='HUaQK'></bdo><ul id='HUaQK'></ul>
                  本文介绍了禁止谷歌地图意图选择对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  当我使用这段代码时

                     string url = "somegooglemapsurl.com";
                     Intent mapLauncherIntent = new Intent(android.content.Intent.ACTION_VIEW,  Uri.parse(url));
                     startActivity(mapLauncherIntent);
                  

                  会弹出一个选择对话框,询问我是否要在地图应用程序或浏览器中打开此地图.我希望从我的应用程序活动到 Google 地图的过渡是无缝的.如何抑制此对话框并告诉 android 在地图活动中打开地图?

                  A selection dialog pops up asking if I want to open this map in the maps application or the browser. I'd like the transition from my application activity to Google Maps to be seamless. How can I suppress this dialog and tell android to open the map in the maps activity?

                  当我进入谷歌地图时,我想在某个位置使用公共蒸腾打开一个方向提示.我可以通过 google maps url 做到这一点,但是 url 会弹出选择对话框.

                  When I get into Google Maps I want to open a directions prompt using public transpiration in a certain location. I can do this through a google maps url, but a url brings up the selection dialog.

                  推荐答案

                  我还没有找到完美的解决方案,但这至少可以打开预先选择正确目的地和公共交通的地图.然后用户所要做的就是点击方向按钮.

                  I haven't found a perfect solution, but this will at least open maps with the correct destination and public transportation pre-selected. Then all the user has to do is hit the directions button.

                  它还会检查是否安装了谷歌地图,如果安装了,则更喜欢使用它.

                  It also checks if google maps is installed and prefers to use that if so.

                  Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("http://maps.google.com/maps?daddr=0,0%20(Imaginary%20Place)&dirflg=r"));
                  if (isAppInstalled("com.google.android.apps.maps")) {
                      intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
                  }
                  startActivity(intent);
                  

                   

                  // helper function to check if Maps is installed
                  private boolean isAppInstalled(String uri) {
                      PackageManager pm = getApplicationContext().getPackageManager();
                      boolean app_installed = false;
                      try {
                          pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);
                          app_installed = true;
                      } catch (PackageManager.NameNotFoundException e) {
                          app_installed = false;
                      }
                      return app_installed;
                  }
                  

                  这篇关于禁止谷歌地图意图选择对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:在 Android 中创建自定义对话框 下一篇:如何在对话框显示时隐藏键盘?

                  相关文章

                  最新文章

                      <small id='GgCnQ'></small><noframes id='GgCnQ'>

                      • <bdo id='GgCnQ'></bdo><ul id='GgCnQ'></ul>

                      <legend id='GgCnQ'><style id='GgCnQ'><dir id='GgCnQ'><q id='GgCnQ'></q></dir></style></legend>

                    1. <i id='GgCnQ'><tr id='GgCnQ'><dt id='GgCnQ'><q id='GgCnQ'><span id='GgCnQ'><b id='GgCnQ'><form id='GgCnQ'><ins id='GgCnQ'></ins><ul id='GgCnQ'></ul><sub id='GgCnQ'></sub></form><legend id='GgCnQ'></legend><bdo id='GgCnQ'><pre id='GgCnQ'><center id='GgCnQ'></center></pre></bdo></b><th id='GgCnQ'></th></span></q></dt></tr></i><div id='GgCnQ'><tfoot id='GgCnQ'></tfoot><dl id='GgCnQ'><fieldset id='GgCnQ'></fieldset></dl></div>
                      <tfoot id='GgCnQ'></tfoot>