简体   繁体   English

从Dialer打开Android应用

[英]Open Android App from Dialer

I have implemented a Broadcast Receiver to open my app from the launcher. 我已经实现了一个广播接收器,以从启动器打开我的应用程序。 The number to open is #1234# 打开的号码是#1234#

Now it works perfectly in some devices while it doesn't in some. 现在,它可以在某些设备中完美运行,而在某些设备中则无法。 Now my question is how is this even possible? 现在我的问题是这怎么可能?

If it works, then it should work in all devices isn't it? 如果可以,那么它应该可以在所有设备上使用,不是吗? Also I need suggestions on what would be the best practice to ensure that it works on all devices. 另外,我还需要建议一些最佳实践,以确保它可以在所有设备上正常工作。

Thanks. 谢谢。

Now my question is how is this even possible? 现在我的问题是这怎么可能?

Yes it is pretty much possible. 是的,这很有可能。

If it works, then it should work in all devices isn't it? 如果可以,那么它应该可以在所有设备上使用,不是吗?

No, Reason behind your implementation not working can be but not limited to are given below. 不,您的实现无法正常运作的原因可以是但不限于以下原因。

1) Every Phone Manufacturer tweak Android OS code(As Android is Open Source). 1)每个电话制造商都调整Android OS代码(因为Android是开源的)。 There can be chance of have given priority to System Apps first then public apps. 有可能先将系统应用程序设置为优先级,然后再将公共应用程序设置为优先级。

2) There can be other apps(System/Public both) running on the phone, which are listening on the same BroadCast Intent and taking action before your app does anything. 2)手机上可能运行着其他应用程序(系统/公共),它们正在监听相同的BroadCast Intent,并在您的应用程序执行任何操作之前采取措施。

3) Phone are slow and your receiver getting command little later then expected!! 3)电话很慢,您的接收器稍晚才收到命令!

Share more details on your testing to get more feedback. 分享有关测试的更多详细信息,以获得更多反馈。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM