Mọi người cho tớ hỏi vì sao chương trình này chạy trên ADV bị stoped nhỉ

SOURCE file XML.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="dunglt.kiemtrasuckhoe.Activity_kiem trasuckhoe" >

<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="194dp"
android:orientation="vertical" >
</LinearLayout>

<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textView1"
android:layout_alignBottom="@+id/textView1"
android:layout_toRightOf="@+id/linearLayout1"
android:ems="10" >

<requestFocus />
</EditText>

<EditText
android:id="@+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/editText1"
android:layout_alignTop="@+id/textView2"
android:ems="10" />

<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/linearLayout1"
android:layout_centerHorizontal="true"
android:layout_marginBottom="14dp"
android:text="Chẩn Đoán" />

<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/linearLayout1"
android:layout_centerHorizontal="true"
android:layout_marginTop="45dp"
android:text="BMI"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignTop="@+id/textView3"
android:text="BMI" />

<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView3"
android:layout_below="@+id/textView3"
android:layout_marginTop="44dp"
android:text="Chan Doan"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textView5"
android:layout_alignBottom="@+id/textView5"
android:layout_alignLeft="@+id/textView4"
android:text="Chẩn Đoán" />

<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView4"
android:layout_alignParentTop="true"
android:layout_marginTop="52dp"
android:text="chiều cao (mét)" />

<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_below="@+id/editText1"
android:layout_marginTop="28dp"
android:text="Cân Nặng (kg)" />

</RelativeLayout>

SOURCE FILE .java

package dunglt.kiemtrasuckhoe;

import java.text.DecimalFormat;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class Activity_kiemtrasuckhoe extends ActionBarActivity {

// TODO Auto-generated method stub
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_activity_kiemtras uckhoe);
final TextView BMI = (TextView) findViewById(R.id.textView4);
final TextView chandoan = (TextView) findViewById(R.id.textView5);
final EditText chieucao = (EditText) findViewById(R.id.editText1);
final double H = Double.parseDouble(chieucao.getText() + "");
final EditText cannang = (EditText) findViewById(R.id.editText2);
final double W = Double.parseDouble(cannang.getText() + "");
final Button kiemtra = (Button) findViewById(R.id.button1);
final double bmi = W / Math.pow(H, 2);
kiemtra.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
// TODO Auto-generated method stub
String chan_doan = "";
if (bmi < 18) {
chan_doan = "Bạn Gầy ";
} else if (bmi <= 24.9) {
chan_doan = "Bạn Bình Thường";
} else if (bmi < 29.9) {
chan_doan = "Bạn béo phì độ 1";
} else if (bmi < 34.9) {
chan_doan = "Bạn béo phì độ 2";
} else if (bmi > 34.9) {
chan_doan = "Bạn béo phì độ 3";
}
DecimalFormat dcf = new DecimalFormat("#.0");
BMI.setText(dcf.format(bmi));
chandoan.setText(chan_doan);
}

});

}
}

Chủ đề tương tự: