我正在尝试使用捆绑包。但是代码却给了我一些错误。paramBundle.open返回一个错误:无法解析方法open(),方法close()对我来说也是如此。AnimationGetNewNumber方法也无法解析。我究竟做错了什么 ?
protected void onCreate(Bundle paramBundle) {
super.onCreate(paramBundle);
setContentView(R.layout.activity_add_edit_animation);
getIntent().getExtras();
if (getIntent().getExtras().getInt("AEA_INT_ACTION", 0) == 0)
{
Bundle bundle= new Bundle(paramBundle);
paramBundle.open();
this.animationNumber = paramBundle.AnimationGetNewNumber();
paramBundle.close();
}
for (;;)
{
this.gridView = ((GridView)findViewById(R.id.gridviewAddEdit));
this.gridView.setChoiceMode(1);
this.imageAdapter = new ImageAdapter(this, this.animationNumber);
this.gridView.setAdapter(this.imageAdapter);
this.gridView.setOnItemClickListener(this);
this.gridView.setOnItemLongClickListener(this);
return;
this.animationNumber = getIntent().getExtras().getInt("AEA_INT_NUMBER", 0);
}
}
您想从保存的实例束中检索数据,然后在活动中使用以下方法。
@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
this.animationNumber = savedInstanceState.AnimationGetNewNumber();//your code of retriving data from bundle
Log.i("debug", "saved data: " + myString);
}
注意:捆绑软件实例没有open()和close()方法。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句