请帮助我。我想将项目名称、数量、数量和费率的数组列表从制作订单活动传递到下一个活动确认订单...但是在下一个活动中为该数组列表获取空值我该怎么办?
订单代码
Intent intent = new Intent(MakeOrder.this,Demo.class);
intent.putStringArrayListExtra("selectedItems",strItemNameAlert);
intent.putStringArrayListExtra("selectedRates",strRateAlert);
intent.putStringArrayListExtra("selectedQuantity",strQuantityAlert);
intent.putStringArrayListExtra("selectedAmount",strAmountAlert);
intent.putStringArrayListExtra("selectedId",strItemIdAlert);
startActivity(intent);
确认订单代码
public class ConfirmOrder extends Activity {
ArrayList<String> resultArrItemname;
ArrayList<String> resultArrItemrate;
ArrayList<String> resultArrItemquantity;
ArrayList<String> resultArrItemamount;
ArrayList<String> resultArrItemid;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.demo);
resultArrItemname=new ArrayList<String>();
resultArrItemrate=new ArrayList<String>();
resultArrItemquantity=new ArrayList<String>();
resultArrItemamount=new ArrayList<String>();
resultArrItemid=new ArrayList<String>();
Intent intent1=new Intent();
resultArrItemname = intent1.getStringArrayListExtra("selectedItems");
resultArrItemrate = intent1.getStringArrayListExtra("selectedRates");
resultArrItemquantity = intent1.getStringArrayListExtra("selectedQuantity");
resultArrItemamount = intent1.getStringArrayListExtra("selectedAmount");
resultArrItemid = intent1.getStringArrayListExtra("selectedId");
}