how to hide the notification bar at the bottom

kalarius

Active Member
Licensed User
Longtime User
at the bottom of the screen there is a notification bar (show the time , wifi,volume control etc)

how can I hide it?

I use full screen and no title ans at the top is ok. but when I play my avi file I saw on the avi the time , wifi , icons of the basic4adroid connect etc.
or how can I say to autohode like the taskbar of the wondows?
 

kalarius

Active Member
Licensed User
Longtime User
What version of Android are you running, ICS? Let us know, in ICS they are said to be on all the time and you can't turn them off but there may be a way!:)

the version of the android is 4.0.4
inside my device mk802 there is a media player that take full screen and does not show the notification or title bars.
the avi file shows on all the screen.
 
Upvote 0

margret

Well-Known Member
Licensed User
Longtime User
You will need the Reflection & Phone libraries.
You will need to compile with SDK 14 or above
You should add Target 14 to Your manifest, Example:
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>


You will need to add this code to your Globals sub:

B4X:
Dim oldActivityHeight As Int

And you will need to add this code to your Activity:

B4X:
Sub SetNavigationButtons(pView As View, pMode As Int)
   If p.SdkVersion >= 14 Then
      Dim r As Reflector
      Dim l As LayoutValues
      l = GetDeviceLayoutValues
      r.Target = pView
      r.RunMethod2("setSystemUiVisibility", pMode, "java.lang.int")
      r.Target = r.GetActivity
      r.Target = r.RunMethod("getWindow")
      r.RunMethod4("setFlags", Array As Object(0, 1024), Array As String("java.lang.int", "java.lang.int")) 
      Activity.Height = oldActivityHeight
      DoEvents
   End If
End Sub
Sub NavOff
   SetNavigationButtons(Pan, 1)
End Sub
Sub NavOn
   SetNavigationButtons(Pan, 0)
End Sub

You also need to create a Panel in your layout file. Just an empty panel any size like 100 x 100. Set the Panel color to .Transparent and set the Alpha to 0. Now in the two subs, NavOff and NavOn, replace the word Pan with the name of your Panel. Don't forget to add the Dim statement for your Panel.

From code, call NavOff to hide the controls and call NavOn to show them again. They will also turn back on if you touch the screen in the controls area.
 
Last edited:
Upvote 0

kalarius

Active Member
Licensed User
Longtime User
thank

that work fine

**** at then bottom at the left possition there is 3 black cyrles and at the right there is one blck cyrle and when click with the mouse on it the notification bar appears
do you know what are they

my screen is a TV 1280X800 resolution.
I have not tougth
iam using mouse and keybord
 
Upvote 0

margret

Well-Known Member
Licensed User
Longtime User
Those little dots are the place holders for where the control icons are normally shown. ICS will not let you completely turn off the control bar but they let you dim it and show the dots as place holders. If you click right on one of the dots it will perform the same fuction as would the icons if they were showing.
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
I've created a copy of your test program and it does make the notification bar disappear. However, the entire activity disappears except for the title line as well.
Also, when you touch the notification bar it all re-appears. Is this supposed to be this way or do you have to repetitively run the off routine?
Thanks,
 
Upvote 0

kalarius

Active Member
Licensed User
Longtime User
auto start the program WITHOUT service

I do not want to make a service.
I fount this at the android documentation How to start automatic the program when power up the device.

****************************
in ansroidmanifest.xml (application-part):
<receiver android:enabled="true" android:name".BootUpReceiver"
android:permission="android.permission.RECEIVE_BOOT_COMPLETED">

<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" />
</receiver>

[.....]

<uses-permisions android:name"android.permission.RECEIVE_BOOT_COMPLETED" />

[....]



public class BootUPReceiver extends BroadcastReceiver{

@override
public void onReceive(Context context, Intent intent) {
intent i=new intent(context,MyActivity.class);
i.addFlags(intent.FLG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
}

How can we use it at basic?

****** I do not want to make service!!!!
 
Upvote 0

padvou

Active Member
Licensed User
Longtime User
What if I didn't want it for a panel but for the whole activity, to hide notification bar?
Also please take a look at attached image. I 'd like to know if it's possible to hide the bar on the top.
sanei.jpg
 
Last edited:
Upvote 0
Top