尝试使用 Android 2.3.3 项目中另一个服务的意图启动服务时出现错误。错误是:Unable to start service with Intent{ act=(class name) cmp=(class name)/.(android name) }: java.lang.IllegalArgumentException:provider==null
方法调用:
private void startLocationService(){
intent = new Intent("com.example.Android.LocationService");
intent.setClass(MainService.this.getApplicationContext(), LocationService.class);
startService(intent);
}
显现:
<service android:name=".LocationService">
<intent-filter>
<action android:name="com.example.Android.LocationService"/>
</intent-filter>
</service>
</application>