Android服务停止工作

时间:2012-03-05 16:54:48

标签: android service

我已在我的应用程序中实现了服务。它适用于android 2.3.5和较低的SDK设备,最近我买了android4.0设备,当我测试应用程序,服务停止工作,我测试运行服务从设置(设置 - >应用程序 - >运行服务)那里对于我的应用程序,它显示0进程和1个服务(重新启动)。当我检查logcat时,我收到以下错误

权限拒绝:接收Intent {act = android.intent.action.BOOT_COMPLETED flg = 0x10}到com.xxxxx.yyyyy需要 android.permission.RECEIVE_BOOT_COMPLETED由于发件人null(uid 1000)

问题是什么?请帮我解决这个问题。

我的Manifest.xml文件代码

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxxx.yyyy"
android:versionCode="4"
android:versionName="1.3" >

<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="com.xxxx.yyyy.permission.C2D_MESSAGE" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.RECEIVE_SMS" /> 
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />       
<uses-permission android:name="android.permission.WRITE_SMS" />
<uses-permission android:name="android.permission.BROADCAST_SMS"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> 
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />    

<application 
    android:icon="@drawable/icon" android:label="@string/app_name" android:name=".ApplicationStart"
    android:configChanges="locale" >
    <activity 
        android:name=".SplashScreen"
        android:label="@string/app_name"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>


    <activity 
        android:name=".ThanksScreen" 
        android:windowSoftInputMode="adjustResize" 
        android:screenOrientation="portrait" 
        android:configChanges="keyboardHidden|orientation"/>    

    <receiver android:name=".MyStartupIntentReceiver">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
            <category android:name="android.intent.category.HOME" />
        </intent-filter>
    </receiver>

    <service android:name=".services.CallService">
    <intent-filter>
            <action android:name="com.xxxx.yyyy.services.CallService" />
    </intent-filter>

    </service>

</application>

0 个答案:

没有答案