首页 技术 正文
技术 2022年11月14日
0 收藏 863 点赞 3,023 浏览 1470 个字

阅读Android操作系统的 packages/apps/phone/AndroidManifest.xml,是如何暴露的

Android-隐式意图激活操作系统通话界面  AndroidManifest.xml

Android-隐式意图激活操作系统通话界面

Android操作系统在这里明确指定要这个权限:

Android-隐式意图激活操作系统通话界面


我的应用去隐式意图激活,Android操作系统的 packages/apps/phone/

现在知道为什么,一定要在AndroidManifest.xml里面配置权限了吧

  <!--
Android操作系统的 packages/apps/phone/AndroidManifest.xml
明确指定要打电话权限 android:permission="android.permission.CALL_PHONE"
-->
<uses-permission android:name="android.permission.CALL_PHONE" />

现在知道为什么,一定要这样才能激活 Android操作系统的 packages/apps/phone/ 通话功能了吧

Android操作系统 packages/assp/phone/ 暴露了很多 intent-filter,随意匹配一个intent-filter 就可以了,那就匹配下面的intent-filter

    <!-- CALL action intent filters, for the various ways
of initiationg an outgoing call. -->
<intent-filter>
<action android:name="android.intent.action.CALL" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>

Android操作系统 packages/assp/phone/AndroidManifest.xml/打电话相关 是怎么去intent-filter暴露的,我就怎么去激活

  /**
* 隐式意图方式激活
* 激活操作系统通话界面
* @param view
*/
public void startCall(View view) {
/**
* Android操作系统的 packages/apps/phone/AndroidManifest.xml 是这样暴露的
* <!-- CALL action intent filters, for the various ways of initiationg an outgoing call. -->
* <intent-filter>
* <action android:name="android.intent.action.CALL" />
* <category android:name="android.intent.category.DEFAULT" />
* <data android:scheme="tel" />
* </intent-filter>
*/ Intent intent = new Intent();
intent.setAction("android.intent.action.CALL");
// 在这里为什么不需要设置:category android:name="android.intent.category.DEFAULT",因为在startActivity会自动添加
intent.setData(Uri.parse("tel:1345678977")); // 必须要加 :
startActivity(intent);
}

效果图:

Android-隐式意图激活操作系统通话界面

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,997
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,511
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,355
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,138
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,770
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,848