程序功能:在主界面中有两种模式选择,一个是会议模式,一个是正常模式,当选择会议模式,手机设定为静音,当选择为正常模式,手机设定为响铃。当单击添加按钮时,系统会自动从编辑框中提取输入电话号码,若输入的电话号码不全为数字时,会提示出错。
程序效果如下:
首先给出布局文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RadioGroup
android:id="@+id/rg"
android:layout_marginTop="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/rb1"
android:text="会议模式"
/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/rb2"
android:text="正常模式"
/>
</RadioGroup>
<LinearLayout
android:layout_wid