Blogtrottr
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 發問中
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 發問中
java(android)程式有錯誤但我找不出來請大大幫忙
Jul 12th 2013, 16:31

如題,編輯器顯示DeadCode請大大幫我找一下哪裡有錯誤,謝謝!!

-------------顯示DeadCode部分-------------
if (R.id.userinput_height > 10 & R.id.userinput_height < 300 & R.id.userinput_weight > 1 & R.id.userinput_weight < 800) {
try {

double height = Double.parseDouble(info_height.getText().toString())/100;
double weight = Double.parseDouble(info_weight.getText().toString());
double BMI = weight / (height * height);
TextView result = (TextView)findViewById(R.id.result);
result.setText(getText(R.string.yourBMI) + nf.format(BMI));

TextView suggest = (TextView)findViewById(R.id.suggest);
if (BMI > 25) {
suggest.setText(R.string.advice_heavy);
} else if (BMI < 20) {
suggest.setText(R.string.advice_light);
} else {
suggest.setText(R.string.advice_normal);
}
} catch (Exception obj) {
Toast.makeText (MainActivity.this, R.string.input_error, Toast.LENGTH_SHORT) .show();
}
} else {
Toast.makeText (MainActivity.this, R.string.input_error, Toast.LENGTH_SHORT) .show();
}
----結束-------
排版不太好看請見諒

This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends: 'You Say What You Like, Because They Like What You Say' - http://www.medialens.org/index.php/alerts/alert-archive/alerts-2013/731-you-say-what-you-like-because-they-like-what-you-say.html

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 omoss 的頭像
    omoss

    中視聶小倩線上看 , 聶小倩線上看第二集 , 聶小倩 中視 , 聶小倩電視劇 , 聶小倩

    omoss 發表在 痞客邦 留言(0) 人氣()