-3

i created a blank app bar in an activity, inserted a text and everything was working fine, i modified the code a little and now the application name shown in the app bar, how to remove it and where did it come from? here is the design and the output

and here the code

<android.support.v7.widget.Toolbar
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?attr/colorPrimary"
    android:theme="?attr/actionBarTheme"
    android:minHeight="?attr/actionBarSize"
    android:id="@+id/toolbar"
    android:layout_alignParentTop="true"
    android:layout_alignParentStart="true"
    />
AskNilesh
  • 67,701
  • 16
  • 123
  • 163
All_Rounder
  • 1
  • 1
  • 3

2 Answers2

0

to remove title from action bar try this

Toolbar toolbar=(Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle("");

try this to change actionbar title

Toolbar toolbar=(Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle("your title");// set your title name
AskNilesh
  • 67,701
  • 16
  • 123
  • 163
  • worked nice and clear(much appreciated), may i know what was the error? – All_Rounder Aug 16 '17 at 13:45
  • I see, your answer was very helpful but i don't have the required reputation to accept answers yet, sorry. – All_Rounder Aug 16 '17 at 17:44
  • @All_Rounder no need of reputation just mark my ans as correct – AskNilesh Aug 17 '17 at 04:26
  • oh sorry, i am still a newbie, i got this "You have reached your question limitIt looks like you might need a break - take a breather and come back soon!", can you tell me what was wrong with my question? so i can ask better in the future. – All_Rounder Aug 18 '17 at 06:46
0

Add label to your activity in manifest

<activity
        android:name=".ui.SplashActivity"
        android:label="@string/name_you_want"
        android:clearTaskOnLaunch="true"
        android:excludeFromRecents="true"
        android:screenOrientation="sensor"
        android:theme="@style/Apollo.Landing">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>