按钮设置OnClickListener事件监听器时 -> 运行测试死机问题
代码如下:package cn.itcast.tao;
import javax.crypto.NullCipher;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.os.Build;
public class MainActivity extends ActionBarActivity {
public EditText haomakuang ;
public Button queren = null ;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
haomakuang = (EditText) findViewById(R.id.haomakuang);
queren = (Button) findViewById(R.id.queren);
//
// queren.setOnClickListener(new OnClickListener(){
//
// @Override
// public void onClick(View v) {
// String haoma = haomakuang.getText().toString();
// System.out.println("号码是"+haoma);
// }
// });
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment())
.commit();
}
}
}