안녕하세요
다른프로젝트 서비스 호출을 하는 테스트를 하고 있는데 잘안되서 문의드립니다
sample1 과 sample2라는 앱 2개를 만들었습니다
1에서 2의 서비스를 바로 호출하고 싶은데 Unable to start service Intent 오류가 나오면서 잘안되네요..
sample2에 서비스 (windowmanager를 사용하고 있는 서비스 앱위에그리기 권한은 다 설정되있음)
<service
android:enabled="true"
android:exported="true"
android:name=".Sample2Service"
android:process=":remote"
>
<intent-filter>
<action android:name="com.example.sample2.Sample2Service" />
</intent-filter>
</service>
</application>
sample1에서는 it 1234,를 실행했는데 잘안됩니다
Intent it1 = new Intent();
ComponentName compName = new ComponentName("com.example.sample2","com.example.sample2.Sample2Service");
it1.setComponent(compName);//Unable to start service Intent
Intent it2 = new Intent();
it2.setAction("com.example.sample2.Sample2Service");
it2.setPackage("com.example.sample2"); //Unable to start service Intent
Intent it3 = new Intent("com.example.sample2.Sample2Service");// Service Intent must be explicit
it3.setPackage("com.example.sample2"); //Unable to start service Intent
Intent it4 = new Intent();// Service Intent must be explicit
it4.setClassName("com.example.sample2","com.example.sample2.Sample2Service"); //Unable to start service Intent
startService(it4);
sample2내에서는 서비스 호출이 잘됩니다만
1에서의 매니페스트 옵션은 true,false 나 remote 옵션을 뺏다 넣다 해봤는데
1에서 호출하는경우 unable to start service intent 오류가 나옵니다
참고로 1에서 2의 activity를 호출하면 잘됩니다만 서비스 호출은 잘안되네요..