@@ -301,6 +301,11 @@ abstract class ReaderActivity : AppCompatActivity() {
container.addView(readerView)
}
+ override fun onDestroy() {
+ viewModel.saveModifyingAnnotationBeforeDestroy()
+ super.onDestroy()
+ }
+
private fun onPageIndexChanged(pageIndex: Int?) {
pageIndex?.let {
viewModel.setBookmarkDisplay(pageIndex)
@@ -290,6 +290,10 @@ class ReaderViewModel(private val pdfSdkLicense: String, private val pdfSdkRsaMs
+ fun saveModifyingAnnotationBeforeDestroy() {
+ stopAnnotationMode()
fun setPageIndex(pageIndex: Int){
mPageIndexLiveData.value = pageIndex