Tarit Ray
Tarit Ray

Reputation: 994

Android Application Name Appears as horizantal tool bar on the top of each activity

enter image description hereI am getting the application name on the top of each activity, which I do not want .

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="24" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
     <activity
        android:name=".Splash"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".Login"
        android:windowSoftInputMode="stateHidden"
        android:label="@string/app_name" >
    </activity>

while removing android:label="@string/app_name" this i am still getting the app name on each activity as the pakage name of the app.

also tried with <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter>this .

tried all the following answers on the this

But still getting the app name on each and every activity .

Upvotes: 0

Views: 403

Answers (5)

Tarit Ray
Tarit Ray

Reputation: 994

public class UserProfile extends Activity {

ImageView profilePic;
EditText address_up;
Button update_up, exit_up;

@Override
protected void onCreate(Bundle abc) {
    super.onCreate(abc);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.userprofile);

In activity class if you enter the code before setcontentview then action bar will disappear.requestWindowFeature(Window.FEATURE_NO_TITLE);

Or else can create custom style as well.

**

Upvotes: 0

R. Zag&#243;rski
R. Zag&#243;rski

Reputation: 20258

You are using a custom style in Manifest:

android:theme="@style/AppTheme"

Make sure that this style's parent is a .NoTitleBar theme, ie:

<style name="CustomActionBarTheme" parent="Theme.AppCompat.Light.NoActionBar">

Upvotes: 1

Abhishek Singh
Abhishek Singh

Reputation: 9188

If you don't want any action bar then you can change in your value/style

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. such as -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

Upvotes: 0

Evgeni Gergelezhiu
Evgeni Gergelezhiu

Reputation: 1

Or simply pick an existing android theme that hides the actionbar. For example: android:theme="@style/Theme.AppCompat.NoActionBar" You can either do throughout the whole app by setting the application style or only for selected activities.

Hope it helps.

Upvotes: 0

Deepak Sachdeva
Deepak Sachdeva

Reputation: 1010

Create your own style and use it in style.xml. For example

<style name="YourTheme" parent="AppTheme">
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
        <item name="windowActionModeOverlay">true</item>
        <item name="actionModeStyle">@style/SpeazieTheme.ActionMode</item>
    </style>

use it in your manifest file like this

replace

android:theme="@style/AppTheme" 

to

android:theme="@style/YourTheme" 

Upvotes: 1

Related Questions