0

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 .

Community
  • 1
  • 1
Tarit Ray
  • 944
  • 12
  • 24

5 Answers5

1

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" 
Deepak Sachdeva
  • 950
  • 8
  • 16
1

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">
R. Zagórski
  • 20,020
  • 5
  • 65
  • 90
  • Giving runtime error `\StudentDesk\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.NoActionBar'. ` – Tarit Ray Nov 15 '16 at 11:27
  • Is your `Activity` extending `AppCompatActivity`? It should if you want to maintain compatibility with much of Android OS versions. – R. Zagórski Nov 15 '16 at 11:42
0

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>
Abhishek Singh
  • 9,008
  • 5
  • 28
  • 53
0

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.

0
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.

**

Tarit Ray
  • 944
  • 12
  • 24