public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
nameText=(EditText)this.findViewById(R.id.phonename);
phoneText=(EditText)this.findViewById(R.id.number);
try{
Bundle bundle =getIntent().getExtras();
String name= bundle.getString("name");
String phone= getIntent().getSerializableExtra("phone").toString();
System.out.println(phone);
System.out.println(name);
nameText.setText(name);
看这个从上一个activity中用intent传来HashMap,name中有值,但是用那个nameText.setText方法就是不能把值填充到文本框中。这个是有把name值给传过来啦,但是不能填充。大家看下是什么个情况?
楼主name值和phone值在后台能不能打印出来啊?
Log.d("TAG", "name = " + name);
phoneText=(EditText)this.findViewById(R.id.number); 放try里面,然后就不是执行通过了!
放到里面就可以 了