任务 2 BMI BMI BMI 指数(身体质量指数,简称体质指数又称体重指数,英文为 Body Mass Index ,简称 BMI ),是用体重公斤数除以身高米数平方得出的数字,是目前国际上常用的衡量人体胖瘦程度以及是否健康的一个标准。 BMI BMI 男性女性 过轻低于 20低于 19 适中 20-25 19-24 过重 25-30 24-29 肥胖 30-35 29-34 非常肥胖高于 35高于 34 任务简介?了解 Android 程序架构?掌握几种控件的属性/方法/***?掌握几种常见的布局?掌握几种提示方式(Toast ,Dialog ,Notification ) ?掌握 Menu 的使用方法?日志与调试 1-1 Activity ? src 下的 java 文件内容 public class xxxActivity extends Activity { / ** Called when the activity is first created. */ ***@Override public void onCreate(Bundle savedInstanceState) { (savedInstanceState); setContentView(); } } 1-1 Activity ? xxxActivity 的父类是 Activity ? xxxActivity 重写( override )了父类的 onCreate 函数? xxxActivity 初始化时会自动调用 onCreate 函数? savedInstanceState 是一个保存信息的参数,我们目前不使用 1-1 Activity ? setContentView( );代表这个 Activity 将显示 中的内容 xxxActivity 1-2 <?xml version= "" encoding="utf-8"?> <LinearLayout xmlns:android= "http://schemas./apk/res/android" android:orientation= "vertical" android:layout_width= "fill_parent" android:layout_height= "fill_parent" > <TextView android:layout_width= "fill_parent" android:layout_height= "wrap_content" android:text= "***@string/hello" /> </LinearLayout> 1-2 ?紫色部分:线性布局( LinearLayout ) android:orientation= "vertical “方向为垂直 android:layout_width= "fill_parent “宽度:填满父控件 android:layout_height= "fill_parent “高度:填满父控件
BMI(android初学者) 来自淘豆网www.taodocs.com转载请标明出处.