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
    全站熱搜
    創作者介紹
    創作者 nbv272smrgp2u 的頭像
    nbv272smrgp2u

    進擊的巨人14, 進擊的巨人線上看, 進擊的巨人漫畫, 進擊的巨人遊戲, 進擊的巨人 動畫, 進擊的巨人 線上漫畫, 進擊的巨人14線上看, 進擊的巨人13, 進擊的巨人 h, 進擊的巨人op

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