반응형
Greensky0026
삽질러의 대환장 공사판
Greensky0026
전체 방문자
오늘
어제
  • 분류 전체보기 (241)
    • Language (56)
      • JAVA (13)
      • Swift (38)
      • Kotlin (4)
      • Dart (0)
      • PHP (0)
      • JavaScript (1)
    • IDE & Framework (92)
      • Spring (10)
      • Android (48)
      • iOS (8)
      • NodeJS (1)
      • CodeIgniter (3)
      • Flutter (1)
      • 분류중 (18)
    • Infra (8)
    • Database (12)
    • VCS (4)
    • Debug Log (34)
      • java (7)
      • swift (3)
      • Android (9)
      • Web (7)
      • 삽질기 (7)
    • Others (19)
      • 코딩테스트 풀이 (0)
      • IT 이야기 (18)
    • 쉼터 (2)
    • 개발공부 (14)
      • Network (1)
      • 자료구조와 알고리즘 (2)
      • Code design (8)
      • ETC (1)
      • 아카이브 (1)

블로그 메뉴

    공지사항

    • 프로그래머스 코딩 테스트 관련글 비공개 처리

    인기 글

    태그

    • 프로그래밍
    • 공부
    • JSP
    • swfit
    • xcode
    • IT
    • kotlin
    • map
    • reduce
    • ios
    • swift
    • level1
    • 프로그래머스
    • 코딩테스트
    • Android
    • 개발
    • 구축
    • 예제
    • Java
    • 타입

    최근 댓글

    최근 글

    티스토리

    hELLO · Designed By 정상우.
    Greensky0026

    삽질러의 대환장 공사판

    W/BroadcastQueue: Background execution not allowed: receiving Intent
    Debug Log/Android

    W/BroadcastQueue: Background execution not allowed: receiving Intent

    2022. 1. 13. 09:47
    반응형

    상황

     브로드 캐스트 테스트를 위해서, 액션명을 커스텀 해 암시적 브로드캐스트를 생성하였다.

    그리고 송신했을때, 수신측에서 해당 에러를 출력하며 브로드캐스트를 수신하지 못하였다.

     

    원인

     백그라운드 정책이 강화됨에 따라, 예외적인 몇가지 암시적 브로드캐스트를 제외하고

    암시적 브로드캐스트는 매니페스트에 브로드캐스트 수신기를 등록해서 수신할 수 없고,

    Context에 수신기를 구현해야 한다.

     

    해결

    송신시 명시적인 브로드캐스트를 보내도록 수정하였다.

    intent.putExtra("data", "This is just broadcast test B")
    intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
    sendBroadcast(intent)

    에서

    intent.putExtra("data", "This is just broadcast test A")
    intent.setComponent(ComponentName("com.example.broadcasttestb", "com.example.broadcasttestb.MyBroadcastReceiver"))
    intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
    sendBroadcast(intent)

    로 수정.

    반응형
    저작자표시 비영리 (새창열림)

    'Debug Log > Android' 카테고리의 다른 글

    'other' has different root  (0) 2022.04.07
    [Android] 패키지가 잘못되어 앱이 설치되지 않았습니다. 해결  (2) 2022.04.07
    Your app contains exposed Google Cloud Platform (GCP) API keys. Please see this Google Help Center article for details  (0) 2022.01.11
    Build was configured to prefer settings repositories over project repositories but repository 'flatDir' was added by build file 'app\build.gradle'  (1) 2021.11.15
    Manifest merger failed : Attribute application@theme  (0) 2021.11.15
      'Debug Log/Android' 카테고리의 다른 글
      • 'other' has different root
      • [Android] 패키지가 잘못되어 앱이 설치되지 않았습니다. 해결
      • Your app contains exposed Google Cloud Platform (GCP) API keys. Please see this Google Help Center article for details
      • Build was configured to prefer settings repositories over project repositories but repository 'flatDir' was added by build file 'app\build.gradle'
      Greensky0026
      Greensky0026
      점이 모여 선이 된다. 내 삽질도 언젠간 거대한 지하 도시가 되겠지!

      티스토리툴바