서비스와 활동을 동시에 시작하고 싶습니다. 다음 코드를 사용하고 있습니다. 맞습니까?Android - 서비스 및 활동을 동시에 시작하는 방법은 무엇입니까?
startService(new Intent(this, Service.class));
Intent intent = new Intent(this, Activity.class);
startActivity(intent);
하지만 서비스가 완료되면 여기에 작업이 시작됩니다. 왜? 누구든지 도와주세요.
예. startActivity 메소드가 startService() 메소드 다음에 실행되기 때문에 가능합니다. –
그래서 동시에 서비스와 활동을 호출하는 방법은 무엇입니까? – Baskar
startService의 반환 값은 무엇입니까? 서비스가 시작되었는지 여부를 알려줍니다. http://developer.android.com/reference/android/content/Context.html#startService%28android.content.Intent%29 –