Android: action bar pops up by default during application loading

Android When the Android app launches the default action bar for a few seconds, then replaces that action bar with my custom action bar. How to get rid of this default action bar when starting my application.

The following code is used to hide the default action bar. It ultimately replaces my actual action bar.

MainActvity.java

final ActionBar actionBar = getActionBar(); actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayUseLogoEnabled(false); actionBar.setDisplayShowHomeEnabled(false); actionBar.setCustomView(R.layout.actionbar_custom_view_home); 

Android Menifest Code:

  <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="com.example.demowithoutactionbar.MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> 
+6
source share
2 answers

Try using this in your theme presented in styles.xml

<item name="android:windowDisablePreview">true</item>

+5
source

You don’t know how you create an action bar or process your launcher (some code examples may be useful here), but you can prevent the action bar from showing its activity in its launch by specifying this in the manifest:

  <activity android:name=".Splash" android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> 
0
source

Source: https://habr.com/ru/post/955395/


All Articles