我试图制作一个项目,我有一个活动和一个来自不同包装的服务。我把这两个包放在一个项目中。从不同包装启动服务
我把活动:com.idris.activity,我把服务:com.idris.activity.service
我打电话从按钮的听众为MyService在MyActivity这样的:
Intent myIntent = new Intent(getApplicationContext(), MyService.class);
myIntent.putExtra("extraData", "somedata");
startService(myIntent);
应用程序清单
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="idris.parental.monitor"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".MyActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".MyService"
android:enabled="true" />
</application>
</manifest>
为MyService无法启动,什么shuld怎么办?
不工作, 出错信息“10月7日至18日:04:06.975:W/ActivityManager(61):无法启动服务意图{cmp = idris.parental.monitor/.call.CallMonitorService(有额外)}}:找不到“ – adrasa 2012-07-23 15:54:05
发布您的清单文件。 – biegleux 2012-07-23 16:03:06
请再次检查,我已编辑我的帖子 – adrasa 2012-07-23 16:25:12