안드로이드 서비스에서 액티비티 호출하는 법

조회수 9038회
public class LocationService extends Service {

@Override
    public void onStart(Intent intent, int startId) {
        super.onStart(intent, startId);
        startActivity(new Intent(this, activity.class));
    }
}

이런식으로 액티비티에서 실행되는 서비스를 만들었는데요.

조건이 만족하면 액티비티를 호출하게하려고하는데요.

startService(new Intent(WozzonActivity.this, LocationService.class)); LocationService 에서는 액티비티 호출이 안되요.

서비스 클래스에서 현재 작업중인 Context를 받으려면 어떻게 해야하죠?

1 답변

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)