gpt4 book ai didi

android - 在没有 Activity 的情况下获得信号强度

转载 作者:太空宇宙 更新时间:2023-11-03 10:55:49 25 4
gpt4 key购买 nike

作为在线工作的一部分,我需要获取信号强度。我的应用程序没有 Activity 、没有服务和广播接收器。因此,就生命周期而言,我的代码仅在广播 Intent (针对电话调用状态)运行时运行。

我的问题是,我怎样才能挂断 PhoneStateListener,以便在我请求时(或之后不久)接收到有关信号强度的事件。

GSM 信号强度是否未作为可广播事件提供?

(我试图避免必须将此监听器放入服务中)

谢谢。

最佳答案

My question is what can I hang a PhoneStateListener off that will allow me to receive an event about signal strength when (or shortly after) I ask for it.

您不能从 list 注册的 BroadcastReceiver 设置任何类型的监听器。

Is the GSM signal strength not delivered as a broadcastable event?

据我所知还没有。

(I am trying to avoid having to put this listener in a service)

这是一个令人钦佩的目标。您确定需要信号强度吗?

关于android - 在没有 Activity 的情况下获得信号强度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4920676/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com