Search code examples
androidprogressdialogandroid-bundle

Is it possible to pass ProgressDialog through Bundle?


I am stuck in a situation where I want to pass a ProgressDialog object through bundle.

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? 

I have searched the web but could not find any useful answers.


Solution

  • ProgressDialog is too complex to pass it with Bundle. You should save PD's parameters (title, message, progress) and restore the values in a new ProgressDialog.