全屏启动Google地图活动(并隐藏系统用户界面)

时间:2016-07-17 05:56:10

标签: android google-maps

我的应用程序隐藏了系统UI,因此无法看到Nexus 5上的软按钮。我有以下代码来隐藏软按钮

  public void hideSystemUI() {
    View mDecorView = getWindow().getDecorView();
    mDecorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
            | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_FULLSCREEN
            | View.SYSTEM_UI_FLAG_LOW_PROFILE
            | View.SYSTEM_UI_FLAG_IMMERSIVE);
}

到目前为止一切顺利。我的应用程序也开始打开地图的意图,如下所示

String uri = "http://maps.google.com?saddr=Current+Location&daddr=85041";  
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
        Uri.parse(uri));
intent.setClassName("com.google.android.apps.maps",
        "com.google.android.maps.MapsActivity");
startActivityForResult(intent,REQUEST_INTENT_MAPS);
hideSystemUI();

正如您所看到的,上面第二个片段的最后一行调用第一个片段来隐藏系统UI(软按钮)。但是当地图打开时,我仍然会看到软按钮(附有相同的屏幕截图)。

当意图打开另一个应用程序时,如何隐藏系统UI(nexus 5上的软按钮)

How to hide the 3 soft buttons at the bottom of the picture

0 个答案:

没有答案
相关问题