【发布时间】:2010-04-25 16:25:26
【问题描述】:
我有两个应用程序,一个在命名空间 com.gtosoft.voyager 中运行,另一个是 com.gtosoft.dash。我想从 com.gtosoft.dash 启动在 com.gtosoft.voyager 中定义的服务...
我认为我需要一个意图,但是在使用 startService() 启动意图之前,我会传递哪些参数?
如果它们在同一个包中,我可以使用
Intent svc=new Intent (SettingsActivity.this,VoyagerService.class);
startService(svc);
定义服务的清单片段
<application android:icon="@drawable/voyagercarlogo" android:label="@string/app_name" android:debuggable="false">
<provider android:name="com.gtosoft.voyager.VoyagerCProvider"
android:authorities="com.gtosoft.voyager"/>
<service android:name=".VoyagerService"/>
<activity android:name=".SettingsActivity"
android:label="Voyager"
android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
【问题讨论】:
-
很确定它是您所追求的完全限定名称空间的字符串。
-
这是有道理的,但是字符串必须是什么? com.gtosoft.voyager.????
标签: android service android-intent