android 开发之activity之间传递数据
2010-07-05 00:08:00 来源:WEB开发网String s=nf.format(num);
return s;
}
private String getWeight(String sex,double height)
{
String weight="";
if (sex.equals("M"))
{
weight=format((height-80)*0.7);
}
else
{
weight=format((height-70)*0.6);
}
return weight;
}
}
---------------mann.xml-----------------
< ?xml version="1.0" encoding="utf-8"?>
< RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingBottom="4dip"
android:paddingLeft="12dip"
android:paddingTop="4dip"
android:paddingRight="12dip"
>
android:id="@+id/title_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
< TextView
android:id="@+id/text_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="20sp"
android:layout_below="@+id/title_view"
android:text="@string/str_text"
/>
< TextView
android:id="@+id/text_weight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:layout_below="@+id/text_title"
android:text="@string/str_weight"
/>
< RadioGroup
android:id="@+id/RadioGroup01"
android:layout_width="wrap_content"
android:layout_below="@+id/text_title"
android:layout_toRightOf="@+id/text_weight"
更多精彩
赞助商链接