restore

open fun restore(@NonNull fragmentActivity: FragmentActivity, @NonNull listener: ComparisonDialogListener)

Restores the document comparison dialog after a configuration change. This method has to be called after recreating the hosting activity to reset the callback object. This should be called inside the activity's `onCreate()` method.


class MyActivity : FragmentActivity(), ComparisonDialogListener {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        if(savedInstanceState != null) {
            // If this activity is recreated after a configuration change, calling restore() ensures that the document will have the
            // correct callback (this activity) if it was shown before the configuration change. If no dialog was shown, this call is a
            // no-op.
            DocumentComparisonDialogImpl.restore(this, this)
        }
    }

    // ...
}

Parameters

fragmentActivity

Activity that hosts the document comparison dialog fragment.

listener

ComparisonDialogListener to set on any visible comparison dialog.