Can I be informed that an activity intent was sent without registering an activity for it to start

david-hoze

I need to know when a certain intent (in my case ACTION_CALL and ACTION_CALL_PRIVILEGED which are called when the user or an app make a phone call) was sent without registering my activity to handle it.

I don't want to interfere with the normal handling of that intent, i.e. the activity that's supposed to handle it should still handle it the usual manner (in my case the OutgoingCallBroadcaster).

I read here a suggestion to drop the ACTION_CALL_PRIVILEGED intent and issue another one, but want to avoid it. Moreover, I don't want to use an activity for the ACTION_CALL and issue another since it will appear in the intent chooser as an option and I want it to be transparent to the user and to always work.

Also working with the ActivityManager object like this suggestion is not recommended for core logic as stated in the documentation of the getRecentTasks method.

Please tell me if this is possible in Android, and if so how.

Thanks, Amitai

David Wasser

No. This isn't possible. If it were possible it would allow me to write an app that monitors a user's behaviour without him knowing it. ACTION_CALL is an Intent to launch an Activity. You can, of course, intercept this, but that is clearly not what you want to do.

There are broadcast Intents that are sent out during the "call" process. You can monitor these, but you'll have to register to listen for them. Since you indicated that you don't want to register any listeners you are pretty much out of luck.

Which is a good thing, because otherwise people would be able to write a "NastyWare" application.

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Start the trim video activity with an intent

来自分类Dev

Intent 不从 Fragment 启动 Activity

来自分类Dev

Android Activity Not Found 异常:找不到处理 Intent 的 Activity

来自分类Dev

从 Activity 的 2 静态片段中获取 Activity 的 1 Intent extras

来自分类Dev

使用Intent.FLAG_ACTIVITY_MULTIPLE_TASK

来自分类Dev

如何使用Intent切换到Activity?

来自分类Dev

使用InstrumentTest进行自动调用Intent的Activity

来自分类Dev

How do I process broadcasts that were sent while my activity was stopped?

来自分类Dev

Activity.finishAffinity()与Intent.FLAG_ACTIVITY_NEW_TASK | 意图。FLAG_ACTIVITY_CLEAR_TASK

来自分类Dev

Intent.FLAG_ACTIVITY_CLEAR_TASK和Intent.FLAG_ACTIVITY_TASK_ON_HOME之间的区别

来自分类Dev

如何重用代码 Intent intent=new Intent(context,Activity.class) 从超类到子类?

来自分类Dev

Android Intent筛选器重新启动Activity?

来自分类Dev

android Intent.FLAG_ACTIVITY_REORDER_TO_FRONT无法正常工作

来自分类Dev

Intent.FLAG_ACTIVITY_FORWARD_RESULT和PendingIntent

来自分类Dev

Android通知:是否需要Intent.FLAG_ACTIVITY_NEW_TASK?

来自分类Dev

Android:以Intent启动Activity激活WakeLock。如何禁用此行为?

来自分类Dev

通过 Intent 将 Class 传递给 Activity(崩溃)

来自分类Dev

您能否通过 Intent 向后台运行的 Activity 发送数据?

来自分类Dev

为什么同时使用Intent.FLAG_ACTIVITY_NEW_TASK和Intent.FLAG_ACTIVITY_SINGLE_TOP?

来自分类Dev

如何通过intent-filter打开Activity,intent-filter的用途是什么?

来自分类Dev

当使用FLAG_ACTIVITY_NEW_TASK和FLAG_ACTIVITY_CLEAR_TASK设置了Intent时,应用会暂时变白

来自分类Dev

google map implemenyation java.lang.RuntimeException: Unable to start activity

来自分类Dev

Obtain change set of an activity with cleartool without active view

来自分类Dev

Intent.FLAG_ACTIVITY_CLEAR_TOP破坏目标活动。如何避免?

来自分类Dev

是否可以在一个<intent-filter>中为Activity注册两个动作

来自分类Dev

为什么Activity类内的BroadCastReceiver不能接收LocalBroadCastManager从IntentService发送的Intent?

来自分类Dev

活动不从后堆栈甚至从法Intent.FLAG_ACTIVITY_CLEAR_TOP清除

来自分类Dev

将当前的Intent作为额外的传递给另一个Activity

来自分类Dev

最佳做法:创建浏览器Activity或调用ACTION_VIEW Intent?

Related 相关文章

  1. 1

    Start the trim video activity with an intent

  2. 2

    Intent 不从 Fragment 启动 Activity

  3. 3

    Android Activity Not Found 异常:找不到处理 Intent 的 Activity

  4. 4

    从 Activity 的 2 静态片段中获取 Activity 的 1 Intent extras

  5. 5

    使用Intent.FLAG_ACTIVITY_MULTIPLE_TASK

  6. 6

    如何使用Intent切换到Activity?

  7. 7

    使用InstrumentTest进行自动调用Intent的Activity

  8. 8

    How do I process broadcasts that were sent while my activity was stopped?

  9. 9

    Activity.finishAffinity()与Intent.FLAG_ACTIVITY_NEW_TASK | 意图。FLAG_ACTIVITY_CLEAR_TASK

  10. 10

    Intent.FLAG_ACTIVITY_CLEAR_TASK和Intent.FLAG_ACTIVITY_TASK_ON_HOME之间的区别

  11. 11

    如何重用代码 Intent intent=new Intent(context,Activity.class) 从超类到子类?

  12. 12

    Android Intent筛选器重新启动Activity?

  13. 13

    android Intent.FLAG_ACTIVITY_REORDER_TO_FRONT无法正常工作

  14. 14

    Intent.FLAG_ACTIVITY_FORWARD_RESULT和PendingIntent

  15. 15

    Android通知:是否需要Intent.FLAG_ACTIVITY_NEW_TASK?

  16. 16

    Android:以Intent启动Activity激活WakeLock。如何禁用此行为?

  17. 17

    通过 Intent 将 Class 传递给 Activity(崩溃)

  18. 18

    您能否通过 Intent 向后台运行的 Activity 发送数据?

  19. 19

    为什么同时使用Intent.FLAG_ACTIVITY_NEW_TASK和Intent.FLAG_ACTIVITY_SINGLE_TOP?

  20. 20

    如何通过intent-filter打开Activity,intent-filter的用途是什么?

  21. 21

    当使用FLAG_ACTIVITY_NEW_TASK和FLAG_ACTIVITY_CLEAR_TASK设置了Intent时,应用会暂时变白

  22. 22

    google map implemenyation java.lang.RuntimeException: Unable to start activity

  23. 23

    Obtain change set of an activity with cleartool without active view

  24. 24

    Intent.FLAG_ACTIVITY_CLEAR_TOP破坏目标活动。如何避免?

  25. 25

    是否可以在一个<intent-filter>中为Activity注册两个动作

  26. 26

    为什么Activity类内的BroadCastReceiver不能接收LocalBroadCastManager从IntentService发送的Intent?

  27. 27

    活动不从后堆栈甚至从法Intent.FLAG_ACTIVITY_CLEAR_TOP清除

  28. 28

    将当前的Intent作为额外的传递给另一个Activity

  29. 29

    最佳做法:创建浏览器Activity或调用ACTION_VIEW Intent?

热门标签

归档