I already remove the title in onCreate() method.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final ActionBar actionBar = getActionBar();
actionBar.setHomeButtonEnabled(false);
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setDisplayShowTitleEnabled(false);
}
The title is not displayed. But still appears when launching the app.
And I can use
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
or put
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
into manifest file because I'm using actionBar. If I did that, the app crashes.
So, my question is, is there any way to remove the title when the app is launching because I am gonna put a splashscreen here. Thanks.
PLEASE NOTICE:
Thanks for your answers, but I clearly said that I already used actionBar.setDisplayShowTitleEnabled(false);
to hide the title bar of the activity. (as shown in the first picture)
BUT the title bar still appears in the launching screen (as shown in the second picture.)
and
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
and
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
would lead to crash launch. This happens after I used actionbar.
So basically we just need to change DarkActionBar to NoActionBar. NoActionBar theme prevents the app from using the native ActionBar class to provide the app bar. Thus it removes the title of every activity.
Just use getActionBar(). hide(); in your main activity onCreate() method. Save this answer.
I had the same problem.
Personally, I solved it by replacing my Activity inheritance from ActionBarActivity to Activity.
Hope this will help someone...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With