안드로이드 서비스에서 액티비티 호출하는 법
조회수 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를 받으려면 어떻게 해야하죠?
댓글 입력