requestCode = intent.getStringExtra("requestCode");
一般写成if("055".equals(requestCode)){
prodId = intent.getStringExtra("prodId");prodName = intent.getStringExtra("prodName");
webOnlineBean.productId = prodId;/*"prod.100000"*/;
webOnlineBean.productName = prodName;/*"测试";*/
}
而不是f("requestCode".equals(055)){
prodId = intent.getStringExtra("prodId");
prodName = intent.getStringExtra("prodName");
webOnlineBean.productId = prodId;/*"prod.100000"*/;
webOnlineBean.productName = prodName;/*"测试";*/
}
好处:避免requestCode为空值时,报空指针错误;