Check your style.xml file under res->values->style.xml
The style theme will be as followes:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
You need to check if the parent
has the value Theme.AppCompat.Light.DarkActionBar
. It should not have something like Theme.AppCompat.Light.NoActionBar
where app`s your title will not be visible as there is no action bar itself.
You can done using like this..
Create new project & set basic activity in template will give the project with toolbar & appname will shown in toolbar.
File->New Project->Next->Next->Select Basic Activity template(Default its select empty activity)->Finish.
Another Way if you want to view temporarly to see your app name select theme with name contain ActionBar like DarkActionBar you can get the desired results.
The problem can occur when you use too long app name. Try making the app name shorter. I had the same issue and that was my problem.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.