0

After research in goole, I can hide action bar but the current result is the action bar still show few seconds before open MainActivity. You can refer in the gif below.

My question is can we hide action bar immediately when launch app?

Here's my source code

enter image description here

8
  • Hide it always or do you want to show it later? Commented Aug 20, 2022 at 14:29
  • @cmak I need hide it alway when app running Commented Aug 20, 2022 at 14:51
  • Try this stackoverflow.com/a/73293015/15754377 Commented Aug 20, 2022 at 18:26
  • @TraiNguyen if youdon't want any bar, just remove it from the main xml Commented Aug 20, 2022 at 19:30
  • @cmak I already removed it in the xml, you can take a look my source code above Commented Aug 21, 2022 at 3:59

1 Answer 1

1

I change theme like below

 <style name="Theme.Transparent" parent="Theme.AppCompat.Light.NoActionBar"> <item name="android:windowNoTitle">true</item> <item name="android:windowActionBar">false</item> <item name="android:windowFullscreen">true</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowIsTranslucent">true</item> </style> 

In AndroidManifest.xml

<activity android:name=".MainActivity" android:exported="true" android:label="@string/app_name" android:theme="@style/Theme.Transparent"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> 

And the result:

enter image description here

I also commit new source code to HERE if anyone needed

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.