- 相关推荐
android面试题(11)
private TextView view_result;

private TextView view_suggest;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
findViews();
setListensers();
}
// 定义
private void findViews() {
button_calc = (Button) findViewById(R.id.submit);
field_height = (EditText) findViewById(R.id.height);
field_weight = (EditText) findViewById(R.id.weight);
view_result = (TextView) findViewById(R.id.result);
view_suggest = (TextView) findViewById(R.id.suggest);
}
// Listen for button clicks
private void setListeners() {
calcbutton.setOnClickListener(calcBMI);
}
private Button.OnClickListener calcBMI = new Button.OnClickListener() {
public void onClick(View v) {
DecimalFormat nf = new DecimalFormat("0.0");
double height = Double.parseDouble(field_height.getText().toString()) / 100;
double weight = Double.parseDouble(field_weight.getText().toString());
double BMI = weight / (height * height);
// Present result
view_result.setText(getText(R.string.bmi_result) + nf.format(BMI));
// Give health advice
if (BMI > 25) {
view_suggest.setText(R.string.advice_heavy);
} else if (BMI < 20) {
view_suggest.setText(R.string.advice_light);
} else {
view_suggest.setText(R.string.advice_average);
}
}
};
}
总结:
关于项目
在就是你项目经验,一定要突出你遇到什么难点,然后是怎么解决的!把问题引导到你熟悉的领域,或者知识点上,尽量将每个技术点细节凸显出来,
心态:
什么样的面试官都有,去面试的时候要做好一切心理准备,不管是技术还是基础都得扎实。一个人的交谈能力也很重要,总之不是非常标准的普通话, 最起码你说的得让别人听得懂,而且得把面试官讲得非常彻底,这样你获得offer的机会更大,谈工资也有优势~~
【android面试题(11)】相关文章:
android面试题目09-08
Android工程师的面试题08-07
Android工程师面试题10-24
关于Android工程师面试题09-19
Microsoft面试题09-04
iOS面试题07-10
公司面试题09-12
hibernate面试题10-18
英语面试题精选06-13
小升初面试题06-10