File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
test-app/src/main/java/org/readium/r2/testapp/reader Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -152,15 +152,18 @@ open class ReaderActivity : AppCompatActivity() {
152152 }
153153
154154 private fun showOutlineFragment () {
155- supportFragmentManager.commit {
156- add(
157- R .id.activity_container,
158- OutlineFragment ::class .java,
159- Bundle (),
160- OUTLINE_FRAGMENT_TAG
161- )
162- hide(readerFragment)
163- addToBackStack(null )
155+ val outlineFragment = supportFragmentManager.findFragmentByTag(OUTLINE_FRAGMENT_TAG )
156+ if (outlineFragment == null ) {
157+ supportFragmentManager.commit {
158+ add(
159+ R .id.activity_container,
160+ OutlineFragment ::class .java,
161+ Bundle (),
162+ OUTLINE_FRAGMENT_TAG
163+ )
164+ hide(readerFragment)
165+ addToBackStack(null )
166+ }
164167 }
165168 }
166169
You can’t perform that action at this time.
0 commit comments