0

On android 4.4.2 when my app starts its launcher icon appears in the status bar and remains there for the duration of the main activity, that is until finish() is not called. Is there a way not to have it appeared in the status bar? (I am using GCM notifications and one arrives having two nearly identical icons next to each other is quite confusing, needless to say that it takes unnecessary space). Note it does not happen in the previous android versions. Below is my AndroidManifest.xml.

Thanks for any advice.

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.twentydeka.itrash.android"
    android:versionCode="0"
    android:versionName="0" >

    <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="9" />
    <supports-screens android:anyDensity="true"/> 

    <!-- The RedLaser SDK requires that these permissions be set -->
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.VIBRATE" />    
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />        

    <!-- Additional permission required by GCM and OAuth -->
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.USE_CREDENTIALS" />

    <permission android:name="com.twentydeka.itrash.android.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />
    <uses-permission android:name="com.twentydeka.itrash.android.permission.C2D_MESSAGE" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="20deka"
        android:name="com.twentydeka.itrash.android.app.ItrashApplication"
        android:theme="@style/itrash_theme" >

        <!--  activities -->
        <activity
            android:name="com.twentydeka.itrash.android.activity.MainActivity"
            android:label="@string/app_name"
            android:windowSoftInputMode="adjustPan|stateHidden" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

            <intent-filter>
                <action android:name="android.intent.action.SEARCH" />
            </intent-filter>

            <meta-data android:name="android.app.searchable"
                       android:resource="@xml/searchable"/>                      

        </activity>

        <activity
            android:name="com.twentydeka.itrash.android.activity.product.BarcodeScannerActivity"
            android:label="@string/app_name"
            android:configChanges="keyboardHidden|orientation" >
        </activity> 

        <activity android:name="org.acra.CrashReportDialog"
            android:theme="@android:style/Theme.Dialog"
            android:launchMode="singleInstance"
            android:excludeFromRecents="true"
            android:finishOnTaskLaunch="true" > 
        </activity>

        <!--  services -->                                                                                                                                                      
        <service android:name="com.twentydeka.itrash.android.service.ItrashHttpClientService"
            android:exported="false" >
        </service>

        <service android:name="com.twentydeka.itrash.android.service.ItrashGCMSyncService"
            android:exported="false" >
        </service>

        <service android:name="com.twentydeka.itrash.android.service.ProductSyncService"
                android:exported="false" >
        </service>

        <service android:name="com.twentydeka.itrash.android.service.ConsumerHealthCheckService"
                android:exported="false" >
        </service>                              

        <!--  providers -->
        <provider android:name="com.twentydeka.itrash.android.contentprovider.ItrashContentProvider"
            android:authorities="com.twentydeka.itrash.android.contentprovider"
            android:exported="false" >
        </provider>  

        <!-- receivers -->  
        <receiver android:name="com.twentydeka.itrash.android.receiver.GCMSyncBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <category android:name="com.twentydeka.itrash.android" />
            </intent-filter>
        </receiver>

        <receiver android:name="com.twentydeka.itrash.android.receiver.ConsumerHealthCheckBroadcastReceiver" />     

    </application>

</manifest>
quirkfly
  • 121
  • 1
  • 5
  • 2
    If you really mean the status bar -- where `Notification` icons go -- then you are raising a `Notification`. If you do not want to raise a `Notification`, stop raising a `Notification`. – CommonsWare Dec 22 '14 at 18:53
  • 1
    @CommonsWare -- I was going to say Foreground Service. quirkfly, is one of your services a foreground service? – 323go Dec 22 '14 at 18:54
  • @CommonsWare I was not referring to the notification bar I meant the title bar -- where icons like wifi indicator, batery status, time, etc. go. As for the services, all of them inherit from IntentService. – quirkfly Dec 22 '14 at 19:35
  • "where icons like wifi indicator, batery status, time, etc. go" -- that is the status bar. As noted, you are putting the `Notification` there yourself (`NotificationManager` or `startForeground()`), or possibly some third-party library is doing so on your behalf. – CommonsWare Dec 22 '14 at 19:51
  • @CommonWare -- As mentioned I do use notifications, these are indicated with a white icon, the one that appears in the status bar when the app launches is the same as in the action bar (very left) and it is brown. Hence when a notification is raised I end up with two icons white that comes from the notification and can be removed from the status bar and the brown one that stays there until the app will not finish. – quirkfly Dec 22 '14 at 20:14
  • Further investigation revealed that this is happening due to RoboSpice library being use for handling network requests, when commented out the icon has disappeared. Still not sure how to resolve it though. – quirkfly Dec 22 '14 at 22:08

0 Answers0