Android - How to intercept the 'Install application' intent

后端 未结 2 1136
独厮守ぢ
独厮守ぢ 2020-11-30 03:12

OK, so not entirely sure this is possible...

But trying to write an application so that I can run some code before any of the following activities are performed.

2条回答
  •  臣服心动
    2020-11-30 04:16

    Using a BroadcastReceiver you can filter the android.intent.action.PACKAGE_ADDED intent. However this will only be after the two actions you describe, not before. And it will not stop or interrupt the installation.

    AFAIK there is no way to do anything before or to interrupt the Market. And then we're even talking about another app than the one that's being installed ofcourse.

提交回复
热议问题