Home should not be persistent.
Change-Id: I3d124512069637c18651ef91801338b7300fee8c
diff --git a/samples/HelloActivity/src/com/example/android/helloactivity/HelloActivity.java b/samples/HelloActivity/src/com/example/android/helloactivity/HelloActivity.java
index a5a5c96..f983d7a 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 @@
import android.app.Activity;
import android.os.Bundle;
+import android.view.View;
+import android.view.WindowManager;
/**
@@ -33,7 +35,19 @@
// 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 229171f..2e489eb 100644
--- a/samples/Home/AndroidManifest.xml
+++ b/samples/Home/AndroidManifest.xml
@@ -32,8 +32,7 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR"/>
- <application android:persistent="true"
- android:label="@string/home_title"
+ <application android:label="@string/home_title"
android:icon="@drawable/ic_launcher_home">
<activity android:name="Home"