以下是我的启动服务的代码。Android4.0服务已启动
public class MyStartupIntentReceiver extends BroadcastReceiver
{
public void onReceive(Context context, Intent intent)
{
Intent callService = new Intent();
callService.setAction("com.xxxx.yyyy.services.StartServiceActivity");
context.startService(callService);
}
}
在manifest文件中,我定义了如下的广播接收器。
<receiver android:name=".MyStartupIntentReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"
/>
</intent-filter>
</receiver>
进出口申报业务一样。一旦用户从我的活动开始了我的应用即时通讯开始服务清单文件
<service android:name=".services.CallService">
<intent-filter>
<action
android:name="com.xxxx.yyyy.services.StartServiceActivity" />
</intent-filter>
</service>
以下
serviceIntent = new Intent(SplashScreen.this, StartServiceActivity.class);
getApplicationContext().startService(serviceIntent);
问题是服务工作的罚款与android2。 3.5 SDK设备。但不适用于4.0设备。我的代码有任何问题。请帮我解决。