Skip to content

Tip:AgentWeb所在Activity被配置独立进程时,下载通知栏取消任务无效解决方案 #294

Description

@AzureFatty

现象:
AgentWeb所在的Activity在AndroidManifest中被配置独立进程时(例: android:process=":Browser"),进行下载任务时,单击取消按钮会出现无法取消下载任务的情况。

分析:
此情况的原因是由于NotificationCompat.Builder.setDeleteIntent()方法注册广播接收者时候所发出的广播为
LocalBroadcastManager。因此造成了com.just.agentweb.download.NotificationCancelReceiver(因未配置与AgentWeb相同进程)无法收取到广播。

解决方法:
在宿主应用的AndroidManifest进行以下配置

<receiver
            android:name="com.just.agentweb.download.NotificationCancelReceiver"
            android:process=":Browser"
            tools:replace="android:process" />

给遇到此问题的同学一个提醒。

@Justson 建议在README/WIKI进行一下说明。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions