安卓案例-使用QuickContactBadge 关联联系人
2016-12-12 16:46
483 查看
QuickContactBadge 继承了 ImageView 因此它的本质也是图片按钮,也可以通过 android:src 属性指定它显示的图片。QuickContactBadge 额外增加的功能是:该图片可以关联到手机中指定联系人,当用户单机该图片的时候,系统将会打开相应联系人的联系方式界面。
assignContactFromPhone(String phoneNumber,boolean lazyLookup):将该图片关联到指定电话号码对应的联系人
assignContactUri(Uri contactUri) 将该图片关联到特定 Uri 对应的联系人
QuickContactBadge 需要调用的方法
assignContactFromEmail(String emailAddapp\src\main\ress,boolean lazyLookup):将该图片关联到指定 E-mail 地址对应的联系人assignContactFromPhone(String phoneNumber,boolean lazyLookup):将该图片关联到指定电话号码对应的联系人
assignContactUri(Uri contactUri) 将该图片关联到特定 Uri 对应的联系人
本案例效果图如下
布局文件代码如下
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="pub.weber.bym.quickcontactbadge.MainActivity"> <QuickContactBadge android:id="@+id/badge" android:layout_width="120dp" android:layout_height="120dp" android:src="@drawable/c"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="16dp" android:text="weber开发者"/> </LinearLayout>
MainActivity 代码如下
public class MainActivity extends AppCompatActivity { QuickContactBadge badge; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); badge = (QuickContactBadge) findViewById(R.id.badge); badge.assignContactFromPhone("110-12345678",false); } }
by web开发者 更多相关内容请访问: http://weber.pub/
本文地址: http://weber.pub/安卓笔记19(案例)-使用qui…ntactbadge-关联联系人/330.html
相关文章推荐
- Android 使用QuickContactBadge关联联系人
- [Android]笔记12:使用QuickContactBadge关联联系人
- 使用QuickContactBadge关联联系人
- 使用QuickContactBadge关联联系人
- Android界面编程之QuickContactBadge(一幅图片关联到手机上的一个联系人)
- QuickContactBadge的学习 快速关联联系人
- 安卓用QuickContactBadge和AsyncQueryHandler实现联系人列表的完美实现
- QuickContactBadge(联系人快捷标识控件)的使用
- QuickContactBadge实现关联手机联系人
- 【起航计划 009】2015 起航计划 Android APIDemo的魔鬼步伐 08 App->Activity->QuickContactsDemo 联系人 ResourceCursorAdapter使用 QuickContactBadge使用
- QuickContactBadge和AsyncQueryHandler实现联系人列表完美实现
- 使用QuickContactsBadge查询联系人时需要注意的事项
- QuickContactBadge联系人学习
- QuickContactBadge 自定义获取联系人
- MySQL的id关联和索引使用的实际优化案例
- android中提供了QuickContactBadge
- <转>Android2.2 API 中文文档系列(8) —— QuickContactBadge
- 安卓实战案例——TextView的使用
- android.widget.QuickContactBadge