首先看一下布局文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<EditText
android:id="@+id/edit"
android:hint="13057655618"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="dial"
android:text="Dial" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="call"
android:text="Call" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="add"
android:text="add" />