9

How to hide Android status bar in native game written with gomobile?

I am experimenting with a simple native Android game written in pure Go using the gomobile tool. It should be able to use the full screen for rendering frames. However I could not find an API to hide the status bar from the native app.

Has anyone tackled this issue? If so, please share the directions.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
Everton
  • 12,589
  • 9
  • 47
  • 59

3 Answers3

1

Create a Empty Activity . Go and find

android:theme="" on Activity XML Files

Set it to @style/Theme.AppCompat.NoActionBar

Pro Tip :

dont know other people but I always delete

Menu/Menu_Activity.Xml 

That Contains Menu XML files !

Also Remove Menu.OnClick Codes Located on The Class of Your Activity

Update :

Emm ... did you change :

public class Setup extends ActionBarActivity {

to

public class Setup extends Activity {

???

Azrideus
  • 85
  • 2
  • 13
  • Does this make sense for a gomobile native app? I think gomobile works only with GoNativeActivity activity. Look at this example: https://github.com/golang/mobile/blob/master/example/network/AndroidManifest.xml – Everton Aug 21 '17 at 13:35
  • As far as I know, the gomobile app does use Java files. Where in the gomobile project is one supposed to edit the Java class? – Everton Aug 28 '17 at 18:32
0

On the manifest add: theme: Theme.AppCompat.NoActionBar

For each activity page in which you dont want to show the status bar

Yunus Kulyyev
  • 1,022
  • 15
  • 26
0

This is how to disable the Android status bar in a native application written with gomobile:

Add this exact theme to AndroidManifest.xml:

<activity android:name="org.golang.app.GoNativeActivity"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
</activity>
Everton
  • 12,589
  • 9
  • 47
  • 59