안드로이드 개발 질문/답변
(글 수 45,052)
앱에 BroadcastReceiver 를상속받아서
@Override
public void onReceive(Context context, Intent intent)
{
...............................
if (action.equals("android.intent.action.BOOT_COMPLETED")) {
Intent wIntent = new Intent("com.netservice.myservice");
mCtx.startService(wIntent);
위와같이 부팅완료시 특정 서비스를 실행하도록했습니다
특정서비스는 같은앱내에 만들어져있습니다
근데 폰에서 테스트해보면 서비스가 실행되지를 않습니다
왜그런지
어디를 살펴봐야되는지
조언부탁합니다
manifest에 BOOT_COMPLETED 퍼미션도 주셨으면..
아마 mCtx.startService(wintent); 이부분에서 Context를 onReceive에서도 파라미터로 받는데 궂이 따로 context를 지정할 필요 없을 것 같아요.
context.startService(wintent); 로 해보심이 ~