Notice
Recent Posts
Recent Comments
개발일지
[Android] Broadcast Receiver 본문
→ 각각의 컴포넌트들 간에 메시지를 전달할 수 있는 방법을 제공해줌
- 정적으로 리시버 구현하기 → 리시버를 고정해서 등록해 놓고 원하는 intent에 반응하는 리시버
BroadCastReceiver 를 상속받아 onReceive()메서드를 오버라이딩
onReceive()메서드는 intent-filter을 통해 걸러진 intent를 받아들이는 곳 → 원하는 액션을 작성하면 됨
PendingIntent
→ 사용자가 notification 을 통해 특정한 동작을 할 때 실행되는 인텐트를 생성함
사용자가 앱위젯을 통해 특정한 동작을 할 때 실행되는 인텐트를 생성함
가지고 있는 Intent를 보류하고 특정 시점에 작업을 요청하도록 하는 특징이 있음 (미래의 특정 시점에 실행되는 인텐트를 선언함)
- getActivity(Context, int, Intent, int) : 액티비티를 시작하는 인텐트를 생성함
- getBroadcast(Context, int, Intent, int) : 브로드캐스트 리시버를 시작하는 인텐트를 생성함
- getService(Context, int, Intent, int) : 서비스를 시작하는 인텐트를 생성함
'Android' 카테고리의 다른 글
[Android] recyclerview (0) | 2021.06.29 |
---|---|
[Android] AAB; Android App Bundle (0) | 2021.06.29 |
[Android] ConditionVariable (0) | 2021.06.29 |
[Android] gradle (0) | 2021.06.29 |
[Android][Kotlin] Scope Function, Collections (0) | 2021.06.29 |