Can't Hide menuBar on Android

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Joe Kot
Posts: 37
Joined: Wed Sep 14, 2011 2:49 pm

Can't Hide menuBar on Android

Post by Joe Kot » Sun Dec 18, 2011 2:05 am

I'm trying to hide the menu bar on an Android tablet. It works ok on my pc but not on the Android tablet. I've put
hide menuBar and hide taskbar on openstack and on opencard but have had no luck. When I start Angry birds on the same Android tablet the menubar disappears. Thanks Joe

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Can't Hide menuBar on Android

Post by jacque » Sun Dec 18, 2011 8:01 pm

You need to use the mobile version of the command. See the dictionary for mobileHideStatusBar and mobileShowStatusBar.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Joe Kot
Posts: 37
Joined: Wed Sep 14, 2011 2:49 pm

Re: Can't Hide menuBar on Android

Post by Joe Kot » Mon Dec 19, 2011 2:20 am

Hello Jacqueline,

I did try inserting mobileHideStatusBar but I get an error message "Can't find handler" when I run the program.
Is there something else I need to add to the code. Thanks - Joe

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Can't Hide menuBar on Android

Post by jacque » Mon Dec 19, 2011 5:22 am

It's a mobile-only command, so it will only work on a device or in the emulator. For desktop and IDE, you need to use "hide menubar". There are lots of mobile-only commands in the dictionary so you have to keep an eye on the platform support icons to know what works where.

For this kind of thing, you need to test the environment before executing the code. Or you can branch depending on the environment, like this:

Code: Select all

if the environment is "mobile" then
  mobileHideStatusBar
else
  hide menubar
end if
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Joe Kot
Posts: 37
Joined: Wed Sep 14, 2011 2:49 pm

Re: Can't Hide menuBar on Android

Post by Joe Kot » Mon Dec 19, 2011 9:06 pm

The below code worked great. Thank you Jacqueline for providing the code. I know I will use this for all the other mobile-only commands. This will keep my app from giving me a handler error message when it includes a mobile-only command and I test/run my program on my pc. Thank you to Karthik for also informing me that the status bar can be hidden by selecting the status bar hidden option on the Android Stand Alone Application Settings. Joe Kotlinski

if the environment is "mobile" then
mobileHideStatusBar else hide menubar
end if

Nick Johnson
Posts: 16
Joined: Fri Jun 29, 2012 8:05 am

Re: Can't Hide menuBar on Android

Post by Nick Johnson » Thu Aug 16, 2012 7:35 am

There seems to be no way of hiding it completely unless you have a rooted device.
However, you can dim it. Making them sort of invisible, instead you see the dots. Using LIGHTS_OUT

View v = findViewById(R.id.view_id);
v.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);

Post Reply

Return to “Android Deployment”