使用Activity完成以下功能
1)可以从另一个Activity中,获得的不同的电话号码,实现电话拨打。
2)可以打开相机拍照后,显示在图片框
3)可以发送短信
4)界面如图所示
一、页面布局
上代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageButton
android:id="@+id/btn_call"
android:layout_width="135dp"
android:layout_height="100dp"
android:layout_alignParentLeft="true"
android:background="@mipmap/phonecall" />
<ImageButton
android:id="@+id/btn_mail"
android:layout_width="135dp"
android:layout_height="100dp"
android:layout_centerInParent="true"
android:background="@mipmap/message" />
<ImageButton
android:id="@+id/btn_camera"
android:layout_width="140dp"
android:layout_height="100dp"
android:layout_alignParentRight="true"
android:background="@mipmap/camera"
/>
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="20dp">
<EditText
android:layout_width="250dp"
android:layout_height="wrap_content"
android:id="@+id/et_phone1"
android:textSize="20sp"
android:onClick="onClick"
android:hint="phoneNum"/>