Skip to content

Commit 0e39e16

Browse files
committed
bug fix in activity destroy
1 parent b52cede commit 0e39e16

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

pickphotoview/src/main/java/com/werb/pickphotoview/PickPhotoActivity.kt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ class PickPhotoActivity : BasePickActivity() {
4444
getData()
4545
}
4646

47-
override fun onDestroy() {
48-
super.onDestroy()
49-
EventBus.unRegister(this)
50-
PickPhotoHelper.stop()
51-
setContentView(R.layout.pick_null_layout)
52-
}
53-
5447
private fun getData() {
5548
GlobalData.model?.let {
5649
PickPhotoHelper.start(it.isShowGif, applicationContext.contentResolver)
@@ -190,6 +183,9 @@ class PickPhotoActivity : BasePickActivity() {
190183
override fun finish() {
191184
super.finish()
192185
overridePendingTransition(R.anim.activity_anim_not_change, R.anim.activity_anim_top_to_bottom)
186+
EventBus.unRegister(this)
187+
PickPhotoHelper.stop()
188+
setContentView(R.layout.pick_null_layout)
193189
}
194190

195191
}

0 commit comments

Comments
 (0)