是否可以通过Bundle传递ProgressDialog?

时间:2015-01-16 12:16:04

标签: android progressdialog android-bundle

我遇到了想要通过bundle传递ProgressDialog对象的情况。

ProgressDialog PD =  new ProgressDialog();
PD.setMessage("My message");
PD.setCanceledOnTouchOutside(false);
PD.show();

// some other code

Bundle bundle = new Bundle();
bundle.putString("someVal1", textValue);
bundle.putInt("someVal2", integer_name);
bundle.put..... // pass PD here? 

我在网上搜索过但找不到任何有用的答案。

1 个答案:

答案 0 :(得分:2)

ProgressDialog过于复杂,无法通过Bundle传递它。您应该保存PD的参数(标题,消息,进度)并在新的ProgressDialog中恢复值。