mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-01-18 19:20:09 +01:00
catches an exception that shouldn't happen
This commit is contained in:
parent
360bfd7713
commit
e3a28a1571
@ -93,12 +93,20 @@ class DirectMessagesFragment : AbsContentListRecyclerViewFragment<MessageEntries
|
|||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
super.onStart()
|
super.onStart()
|
||||||
bus.register(this)
|
bus.register(this)
|
||||||
AccountManager.get(context).addOnAccountsUpdatedListener(accountListener, null, false)
|
try {
|
||||||
|
AccountManager.get(context).addOnAccountsUpdatedListener(accountListener, null, false)
|
||||||
|
} catch (e: IllegalStateException) {
|
||||||
|
// This really shouldn't happen.
|
||||||
|
}
|
||||||
adapter.updateReadState()
|
adapter.updateReadState()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStop() {
|
override fun onStop() {
|
||||||
AccountManager.get(context).removeOnAccountsUpdatedListener(accountListener)
|
try {
|
||||||
|
AccountManager.get(context).removeOnAccountsUpdatedListener(accountListener)
|
||||||
|
} catch (e: IllegalStateException) {
|
||||||
|
// This really shouldn't happen.
|
||||||
|
}
|
||||||
bus.unregister(this)
|
bus.unregister(this)
|
||||||
super.onStop()
|
super.onStop()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user