My Android app is not displaying the application name \"app_name\", instead its displaying the activity name \"title\". This is from my manifest file;
<
Even I noticed the same and seems that is a bug! You should report it to google :)
You can directly give yours Application name to it like android:lable="app_name" or check yours String.xml file in Values folder
you need
public class MainActivity extends AppCompatActivity {.....}
if you can't extend AppCompatActivity, then you can alternatively add the last line of the code below to show a title in the bar..
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("the name i want to appear");
I have the same problem, solution for me:
on MainActivity.java change:
public class MainActivity extends Activity {...}
for
public class MainActivity extends AppCompatActivity {...}
If you are using Android studio, then you you should extend AppCompatActivity then only the Activity will be displayed.
Example Code: Main Activity: public class MainActivity extends AppCompatActivity
Styles.XML
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
You should replace
<activity android:name=".Main"
android:label="@string/title">
with
<activity android:name=".Main"
android:label="@string/app_name">