获取通讯录中的联系人以及使用Volley请求调用后台接口,获得联系人归属地。
1.activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:context="com.example.contacttest.MainActivity" >
<EditText
android:id="@+id/et_tel"
android:layout_width="match_parent"
android:layout_height="60dp"
android:padding="10dp"
android:textSize="19sp"
android:hint="请输入手机号"
android:background="@null"
android:inputType="phone"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#E0E0E0"
android:layout_below="@id/et_tel"
/>
<ImageView
android:id="@+id/iv_book"
android:layout_width="wrap_content"
android:layout_height="wrap_content"