如何识别接受Android的电话呼入默认的应用程序? [英] How to Identify the Default App that Accepts Incoming Phone Calls in Android?
问题描述
我只是试图找出哪个应用是默认的应用程序来处理我的Android测试设备上的电话。现在,我使用下面的code,这应该工作,但总是返回null:
I'm simply trying to find out which app is the default app to handle phone calls on my Android test device. Right now, I'm using the following code, this SHOULD work, but always returns null:
Intent phoneApp = new Intent(Intent.ACTION_ANSWER);
ResolveInfo app = mPM.resolveActivity(phoneApp, PackageManager.MATCH_DEFAULT_ONLY);
任何想法?它似乎还有因为某些原因没有这方面的资料!
Any ideas? It seems there is no documentation on this for some reason!
推荐答案
您可以使用queryIntentActivities()上的软件包管理系统,找出能够处理这一意图的所有应用程序,但是这是你能做的最。
You can use queryIntentActivities() on PackageManager to find out all the applications that could handle that intent, but that's the most you can do.
不幸的是,有没有办法找出被调用为隐性意图的默认应用程序(从调用一个隐含的意图抛开自己,看到哪些应用程序被启动后)
Unfortunately, there is no way to find out the default application that gets called for that implicit intent (aside from calling that implicit intent yourself, and seeing which application gets launched afterwards)
这篇关于如何识别接受Android的电话呼入默认的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!