Easy way to hide system bar on Android ICS
HideBar has a kiosk mode especially for this use case.
A free download is available at http://ppareit.github.com/HideBar/.
You can also find it in the market at https://play.google.com/store/apps/details?id=be.ppareit.hidebar.
If you want to incorporate it in your own test/survey application you can always contact the developer (see the links for an email). The code could be explained or an Intent
to do the hiding could be provided.
Android ICS hide System bar
I will not talk about the 'why', just about the 'how' :-)
So, about
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
This will not affect tablet devices, which use a system bar rather than a separate navigation
and status bars.
On Tablet, you could try (API Level 14 onward)
myView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
To detect the event, I think you could use this to catch the event:
myView.setOnSystemUiVisibilityChangeListener(
new OnSystemUiVisibilityChangeListener()
{
public void onSystemUiVisibilityChange(int visibility)
{
if (visibility == View.SYSTEM_UI_FLAG_VISIBLE) {
// TODO whatever you want
}
else {
// TODO what to do in the other case
}
}
}
);
More generally, here is an additional advice from 'Professional Android 4 Application development'
It’s generally good practice to synchronize other changes within your
UI with changes in navigation visibility. For example, you may choose
to hide and display the Action Bar and other navigational controls
based on entering and exiting “full screen mode.” You can do this by
registering an OnSystemUiVisibilityChangeListener to your View —
generally, the View you are using to control the navigation visibility
.
Hide Status bar on Android Ice Cream Sandwich
You cannot get rid of the system bar on tablets. You may be able to get rid of the navigation bar and status bar on phones. Please read the "Controls for system UI visibility" section of the Android 4.0 SDK release notes.
is it possible to hide the system bar
You can't hide it but you can disable it, except home. For that you can give your application as home category and let the user choose.
<category android:name="android.intent.category.HOME" />
Rest all can be disable.
add this in manifest.
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR"/>
inside onCreate()
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_home);
View v = findViewById(R.id.home_view);
v.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
where home_view is the parent view of xml file.
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
return false;
}
public void onWindowFocusChanged(boolean hasFocus)
{
try
{
if(!hasFocus)
{
Object service = getSystemService("statusbar");
Class<?> statusbarManager = Class.forName("android.app.StatusBarManager");
Method collapse = statusbarManager.getMethod("collapse");
collapse .setAccessible(true);
collapse .invoke(service);
}
}
catch(Exception ex)
{
}
}
Hide Tablet system bar
Finally after searching lots of time I got some alternativ for my requirement.
I know this is not a good idea for a programmer to back off from this situation but for my time limit I used this way...
I found this link and application which fullfil my requirement
http://www.42gears.com/blog/2012/04/how-to-hide-bottom-bar-in-rooted-android-3-0-tablets-using-surelock/
please visit this once if you want this type of requirement in your application ....
Thanks to all for helping me in my problem...
How to hide system bar and make visible only on touching screen in android
Just make full screen activity in eclipse...and rest will done by android..
Android 4.0.3 Hide Notification Bar and Title Bar
The thing holding the navigation buttons back and home, time, network information etc is referred to as "navigation" bar.
You can not hide it within the given framework, but it is possible if rooting the device is an option for you:
Root device
Install and run Busybox
Install HideBar
In HideBar there is an option to run in 'Kiosk' mode, in which there is no way to re-display the navigation bar. Needless to say, you really need to be careful with this.
This question was also asked here:
Android tablet navigation bar won't hide
How to remove system bars on Android, I mean, all
Android tablet navigation bar won't hide
Is there a way to hide the system/navigation bar in Android ICS
Hide Tablet system bar
Real Fullscreen with Android 4 Tablets
Easy way to hide system bar on Android ICS
Is there a way to hide the system bar in Android 3.0? It's an internal device and I'm managing navigation
You cannot hide the system bar on Android 3.0.
Related Topics
Identifying Rtl Language in Android
How to Change the Background Color Around a Dialogfragment
Get My Phone Number in Android
Gridview with Different Cells Sizes, Pinterest Style
Remove Bottomnavigationview Labels
Disable the Touch Events for All the Views
How to Change Background Color Popup Menu Android
How to Finish an Android Application
How to Get Free and Total Size of Each Storagevolume
How to Do Page Flip/Turn/Curl Effect in Android
Load Large Images with Picasso and Custom Transform Object
How to Pop Fragment Off Backstack
Android Listview Setselection() Does Not Seem to Work
Android Studio: Unable to Start the Daemon Process
How to Tell Which App Was Selected by Intent.Createchooser
Start a Fragment via Intent Within a Fragment