一.学习目标
1. 掌握的 Intent的使用
2. 掌握如何在不同Activity之间通过Bundle传递数据
二.任务描述
如果是男性,标准体重=(身高-80)*0.7
如果是女性,标准体重=(身高-70)*0.6
当点击返回上一页时,在MainActvity中仍显示输入的信息
运行界面如下:
三.编写过程
1.阶段一:进行页面布局
使用RelativeLayout布局进行,布局代码如下:
<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="match_parent"
android:background="@drawable/pg"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_ma