- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
action_battery_low
是否允许从 list 中触发,因为我认为是这样?
这是我的 list :
<reciever android:name=".BatteryReciever">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.BATTERY_LOW"/>
</intent-filter>
</reciever>
但当我从系统收到低电量警告时,它永远不会被触发。只能显式触发吗?
最佳答案
原始问题指出接收者没有收到 Intent 。这是因为接收器被声明为 <reciever>
而不是 <receiver>
.如果接收器元素被正确声明,它就会工作。
另一个主要的混淆来源是 the Android documentation错误引用 "android.intent.action.ACTION_BATTERY_LOW"
和 "android.intent.action.ACTION_BATTERY_OKAY"
.有一个现有的 Android Issue对于此文档错误,但您应该意识到关于该问题的一些评论具有误导性。
相反,接收方的操作必须是 "android.intent.action.BATTERY_LOW"
和 "android.intent.action.BATTERY_OKAY"
.从 Java 源引用这些操作时,您可以使用常量 android.content.Intent.ACTION_BATTERY_LOW和 android.content.Intent.ACTION_BATTERY_OKAY定义正确。
不幸的是,Reto Meier 也错误地定义了 A Deep Dive Into Location 中的 Action .一个问题has been filed也是为了这个。
关于android - ACTION_BATTERY_LOW 未从 list 中解雇?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5393651/
我的代码需要范围守卫,但是我是否必须手动 Dismiss() 从函数正常退出时所有范围守卫?即 void Deleter(MyClass* obj) { delete obj; } MyCla
当 UIPopoverController 被 UIPopoverController 本身的矩形之外的任何地方触摸解除时,是否有一个方法被调用? 状态: firstView 有一个 navBar。它
为调用实现 twilio,我尝试使用广播接收器而不是 twilio 逻辑的 Activity 。我的广播接收器应该通过 onReceive() 捕捉到 Intent ,但实际上并没有。听到了呼唤!但无
在我的应用程序中,我希望在多个 View 中显示 alertview。所以我所做的只是在实用程序类中编写了一个 alertview 并在任何地方使用它。这工作正常。 我什至尝试设置 但徒劳无功。 实用
我想使用具有以下行为/功能的 PopupWindow: 它是可聚焦的(在内部有交互式控件,例如按钮) 弹出窗口“下”的 View 必须正确使用弹出窗口外的触摸 .. 但弹出窗口必须保留在屏幕上,即使在
我正在为 tvOS 开发应用程序,但在取消 UIAlertController 时遇到问题。我在普通 UIViewController 之上呈现一个 UIAlertController。当我按下电视
我有一个 Controller A,还有一个 UIButton,单击它我将呈现一个新的 Controller B。但问题是 Controller B 首先嵌入了 NAV。所以最终我将介绍 UINavi
当我单击从 Web 服务打开所单击项目的数据的列表项时,我想打开一个 ProgressDialog。ProgressDialog 需要出现,直到被点击项目的 WebContent 被打开。 我知道使用
任何人都可以帮助我防止 alertview 在其按钮单击事件中被解雇吗?? 我有一个 textview 作为我的 alertView 的 subview ,如果 textview 的值为 nil,我不
这是按钮操作: @IBAction func readyPressed(sender: NSButton) { self.dismissController(Hardness)
我正在尝试防止当用户点击弹出窗口外部时弹出窗口被关闭。我似乎对此有其他问题/答案,他们似乎都建议使用 modalInPopover 作为 View 。正如我所看到的那样,我已经在 viewDidApp
我正在将 SFSafariViewController 推送到 UITabBarController 中。但单击 Safari 完成按钮会关闭 UITabBarController。如何预防? 最佳答
我有 2 个 viewcontroller,第一个 VC 包含 backButton。 firstVC.h @protocol DVDelegate -(void)DVViewControllerD
这是我的设置: 导航 Controller :ViewcontrollerA -> ViewControllerB ViewcontrollerB 显示一个 imagePickerController
我使用 ProgressDialog 向用户显示他必须等待,并在用户必须等待时使我的应用程序表面“不可触摸”。我向 progressDialog 添加了一个按钮,如果某些条件为真,它应该开始一些操作。
我目前正在尝试实现移动和导出模式的功能。我所做的就是让用户导航到他们想要将文件移动/导出到的目录,然后在他们选择的目录上调用 dismissGrantingAccessToURL,并附加原始文件的文件
我是一名优秀的程序员,十分优秀!