在我的代码中启动 karsilastir 活动时,我总是得到 nullPointerException,这里发送活动代码:
karsilastir.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent intent_notify=new Intent();
intent_notify.setClass(Evraka1Activity.this,karsilastir.class);
Bundle bundle=new Bundle();
bundle.putStringArrayList("urunler", urunler);
intent_notify.putExtra("urunler",bundle);
//startService(intent_notify);
startActivity(intent_notify);
}
这里接收活动代码:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.karsilastirmasonuclari);
Intent intent = getIntent();
Bundle b = intent.getExtras();
gelenurunler = b.getStringArrayList("urunler");
}