- 相關推薦
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);
}
}
};
}
總結:
關于項目
在就是你項目經驗,一定要突出你遇到什么難點,然后是怎么解決的!把問題引導到你熟悉的領域,或者知識點上,盡量將每個技術點細節(jié)凸顯出來,
心態(tài):
什么樣的面試官都有,去面試的時候要做好一切心理準備,不管是技術還是基礎都得扎實。一個人的交談能力也很重要,總之不是非常標準的普通話, 最起碼你說的得讓別人聽得懂,而且得把面試官講得非常徹底,這樣你獲得offer的機會更大,談工資也有優(yōu)勢~~
【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