Android的问题,帮帮小弟Activity/Bundle cannot be resolved to a type怎么解决
Result.java 代码如下package com.android.weight;
/* import相关class*/
import java.text.DecimalFormat;
import java.text.NumberFormat;
public class Result extends Activity{
/** Called when the activity is first created*/
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
/*加载main.xml Layout*/
setContentView(R.layout.result);
/*取得Intent中的Bundle对象*/
Bundle bunde = this.getIntent().getExtras();
/*取得Bundle对象中的数据*/
String 易做图 = bunde.getString("易做图");
double height = bunde.getDouble("height");
/*判断性别*/
String 易做图Text="";
if(易做图.equals("M")){
易做图Text="男性";
}else{
易做图Text="女性";
}
/*取得标准体重*/
String weight=this.getWeight(易做图,height);
/*设定输出文字*/
TextView tv1=(TextView) findViewById(R.id.text1);
tv1.setText("你是一位"+易做图Text+"\n你的身高是"+height+
"公分\n你的标准体重是"+weight+"公斤");
}
/*四舍五入的method*/
private String format(double num)
{
NumberFormat formatter = new DecimalFormat("0.00");
String s=formatter.format(num);
return s;
}
/*以findViewById()取得Button对象,onClickListener*/
private String getWeight(String 易做图,double height)
{
String weight="";
if(易做图.equals("M"))
{
weight=format((height-80)*0.7);
}else
{
weight=format((height-70)*0.6);
}
return weight;
}
}
问题图片: --------------------编程问答-------------------- import android.os.Bundle; --------------------编程问答-------------------- lz,对你的问题我表示很有压力,这么简单的问题,你还要问。
import android.os.Bundle;
补充:Java , Eclipse