diff options
| author | Dianne Hackborn <hackbod@google.com> | 2011-10-17 18:49:50 -0700 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2011-10-17 18:49:50 -0700 |
| commit | e7d00ac68b0f58016654693148ef9fa4cbbad917 (patch) | |
| tree | 560dfda462a6224ed3778ee9b332b2c521321949 /samples/HelloActivity/src/com/example | |
| parent | e842e956c203b322bd39c05ed5660c917b9ae443 (diff) | |
| download | android_development-e7d00ac68b0f58016654693148ef9fa4cbbad917.tar.gz android_development-e7d00ac68b0f58016654693148ef9fa4cbbad917.tar.bz2 android_development-e7d00ac68b0f58016654693148ef9fa4cbbad917.zip | |
Home should not be persistent.
Change-Id: I3d124512069637c18651ef91801338b7300fee8c
Diffstat (limited to 'samples/HelloActivity/src/com/example')
| -rw-r--r-- | samples/HelloActivity/src/com/example/android/helloactivity/HelloActivity.java | 16 |
1 files changed, 15 insertions, 1 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); + } + }); } } |
