初学,这段代码也是在网上找的
Intent intentSimple = new Intent();
intentSimple.setClass(Layout_1.this,Layout_2.class);
Bundle bundleSimple = new Bundle();
bundleSimple.putString("username", username);
bundleSimple.putString("password",password);
intentSimple.putExtras(bundleSimple);
startActivity(intentSimple);
请问为什么出现错误?
你贴的代码没问题,检查一下接受值时有没有问题,问题应该是在Layout_2.class里