From e7d00ac68b0f58016654693148ef9fa4cbbad917 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Mon, 17 Oct 2011 18:49:50 -0700 Subject: [PATCH] Home should not be persistent. Change-Id: I3d124512069637c18651ef91801338b7300fee8c --- .../android/helloactivity/HelloActivity.java | 16 +++++++++++++++- samples/Home/AndroidManifest.xml | 3 +-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/samples/HelloActivity/src/com/example/android/helloactivity/HelloActivity.java b/samples/HelloActivity/src/com/example/android/helloactivity/HelloActivity.java index a5a5c96f1..f983d7a99 100644 --- a/samples/HelloActivity/src/com/example/android/helloactivity/HelloActivity.java +++ b/samples/HelloActivity/src/com/example/android/helloactivity/HelloActivity.java @@ -18,6 +18,8 @@ package com.example.android.helloactivity; import android.app.Activity; import android.os.Bundle; +import android.view.View; +import android.view.WindowManager; /** @@ -33,7 +35,19 @@ public class HelloActivity extends Activity { // Set the layout for this activity. You can find it // in res/layout/hello_activity.xml - setContentView(R.layout.hello_activity); + View view = getLayoutInflater().inflate(R.layout.hello_activity, null); + setContentView(view); + + WindowManager.LayoutParams params = getWindow().getAttributes(); + params.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; + getWindow().setAttributes(params); + view.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() { + @Override public void onSystemUiVisibilityChange(int visibility) { + WindowManager.LayoutParams params = getWindow().getAttributes(); + params.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; + getWindow().setAttributes(params); + } + }); } } diff --git a/samples/Home/AndroidManifest.xml b/samples/Home/AndroidManifest.xml index 229171f35..2e489eb58 100644 --- a/samples/Home/AndroidManifest.xml +++ b/samples/Home/AndroidManifest.xml @@ -32,8 +32,7 @@ -