为什么应用程序启动器图标保留在状态栏中(Android 4.4.2)?

为什么应用程序启动器图标保留在状态栏中(Android 4.4.2)?,android,icons,status,app-launcher,Android,Icons,Status,App Launcher,在android 4.4.2上,当我的应用程序启动时,其启动程序图标将显示在状态栏中,并在主活动期间保持在那里,即直到未调用finish()。有没有办法不让它出现在状态栏中?(我使用的是GCM通知,其中一个到达时有两个几乎相同的图标,彼此相邻,这非常令人困惑,更不用说它占用了不必要的空间)。请注意,在以前的android版本中不会发生这种情况。下面是我的AndroidManifest.xml 谢谢你的建议 <?xml version="1.0" encoding="utf-8"?>

在android 4.4.2上,当我的应用程序启动时,其启动程序图标将显示在状态栏中,并在主活动期间保持在那里,即直到未调用finish()。有没有办法不让它出现在状态栏中?(我使用的是GCM通知,其中一个到达时有两个几乎相同的图标,彼此相邻,这非常令人困惑,更不用说它占用了不必要的空间)。请注意,在以前的android版本中不会发生这种情况。下面是我的AndroidManifest.xml

谢谢你的建议

<?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>


如果您真正指的是状态栏--
通知
图标所在的位置--那么您是在发出
通知
。如果您不想发出
通知
,请停止发出
通知
@commonware——我想说的是前台服务。奇怪的是,你的一项服务是前台服务吗?@commonware我指的不是通知栏,我指的是标题栏——wifi指示器、电池状态、时间等图标都在这里。至于这些服务,它们都是从IntentService继承的。“wifi指示器、电池状态、时间等图标在哪里”——这是状态栏。如前所述,您自己将
通知放在那里(
NotificationManager
startForeground()
),或者可能有第三方库代表您这样做。@CommonWare--如前所述,我使用通知,它们用白色图标表示,当应用程序启动时,状态栏中显示的图标与操作栏中的图标相同(非常左),并且为棕色。因此,当发出通知时,我会看到两个来自通知的白色图标,它们可以从状态栏中删除,而棕色图标会一直保留到应用程序无法完成为止。