mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-04-13 23:12:02 +02:00
fix #200, allow sharing text after device rotating
This commit is contained in:
parent
88761e6c72
commit
4355a79d74
@ -20,8 +20,9 @@ class NotesPagerAdapter(fm: FragmentManager, val notes: List<Note>, val activity
|
||||
val id = notes[position].id
|
||||
bundle.putInt(NOTE_ID, id)
|
||||
|
||||
if (fragments.containsKey(position))
|
||||
if (fragments.containsKey(position)) {
|
||||
return fragments[position]!!
|
||||
}
|
||||
|
||||
val fragment = NoteFragment()
|
||||
fragment.arguments = bundle
|
||||
@ -53,4 +54,10 @@ class NotesPagerAdapter(fm: FragmentManager, val notes: List<Note>, val activity
|
||||
super.destroyItem(container, position, `object`)
|
||||
fragments.remove(position)
|
||||
}
|
||||
|
||||
override fun instantiateItem(container: ViewGroup, position: Int): Any {
|
||||
val fragment = super.instantiateItem(container, position) as NoteFragment
|
||||
fragments[position] = fragment
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user