안드로이드 개발 질문/답변
(글 수 45,052)
알람 형태에 앱을 실험적으로 개발하고 있습니다.
항상 살아 있도록 Service 구성해 놓고, 이 서비스에서 특정한 경우에 다른 화면을
Intent notificationIntent = new Intent("com.test.msgview");
notificationIntent.addFlags(
Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_SINGLE_TOP
| Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_NO_HISTORY
);
notificationIntent.putExtra("msg", msgmsg);
context.startActivity(notificationIntent); // context 는 항상 살아 있는 service
로 실행하면 메시지를 표시하는 화면이 나타납니다.
이 화면이 살아 있는 상태로 다시 이 코드가 실행이 되면
activity에 onResume()이 실행이 되는데,
intent가 내용이 바뀌었음에도 이전 indent 값이 됩니다.
이 intent값을 갱신할 수는 없을까요?
좋은 하루 되세요.




알람형태를 구현하고 싶은면 어떤형태의 어플인지는 모르겠지만 AlarmManager를 이용하는게 어떻가요??
그리고 서비스에서 다른 intent를 호출하는거면 pendingIntent를 이용해서 해당하는 activity를 실행해보는 방법도 있을거같고요..
짧게나마 제가 아는대로 적어봤네요 ^^;;
수고하세요 ~