|
Activity如下:
public class MainActivity extends TabActivity implements Serializable{
.........//若干代码
public void initTab()
{
Bundle bundle = new Bundle();
bundle.putSerializable("main", MainActivity.this);//不报错
Intent intent1 = new Intent();
intent1.setClass(this, AccountActivity.class);
intent1.putExtras(bundle);
myTab.addTab(myTab
.newTabSpec("accout")
.setIndicator("账户",
this.getResources().getDrawable(R.drawable.tab1_over))
.setContent(intent1));
}
public void startAddAcc()
{
Intent intent2= new Intent();
intent2.setClass(MainActivity.this, AddaccActivity.class);
Bundle bundle2= new Bundle();
bundle2.putSerializable("main", MainActivity.this);// 报错
intent2.putExtras(bundle2);
startActivity(intent2);
}
}
错误:
MainActivity没有被Serializable。。。。,那该怎么传呢? |
|