fixed crashes
This commit is contained in:
parent
da5b276e16
commit
16e4b81afa
|
@ -319,7 +319,7 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
|
|||
|
||||
val context = applicationContext
|
||||
TaskStarter.execute(object : AbstractTask<Any?, Any?, Any?>() {
|
||||
override fun doLongOperation(o: Any?): Any? {
|
||||
override fun doLongOperation(params: Any?): Any? {
|
||||
DataStoreUtils.cleanDatabasesByItemLimit(context)
|
||||
return null
|
||||
}
|
||||
|
|
|
@ -39,9 +39,9 @@ class UpdateUserListDetailsTask(
|
|||
private val accountKey: UserKey,
|
||||
private val listId: String,
|
||||
private val update: UserListUpdate
|
||||
) : BaseAbstractTask<Any, SingleResponse<ParcelableUserList>, Any>(context) {
|
||||
) : BaseAbstractTask<Any?, SingleResponse<ParcelableUserList>, Any>(context) {
|
||||
|
||||
override fun doLongOperation(o: Any): SingleResponse<ParcelableUserList> {
|
||||
override fun doLongOperation(params: Any?): SingleResponse<ParcelableUserList> {
|
||||
val microBlog = MicroBlogAPIFactory.getInstance(context, accountKey)
|
||||
if (microBlog != null) {
|
||||
try {
|
||||
|
|
|
@ -326,7 +326,7 @@ class AsyncTwitterWrapper(
|
|||
}
|
||||
|
||||
fun updateFriendship(accountKey: UserKey, userKey: UserKey, update: FriendshipUpdate) {
|
||||
TaskStarter.execute(object : ExceptionHandlingAbstractTask<Any, Relationship, MicroBlogException, Any>(context) {
|
||||
TaskStarter.execute(object : ExceptionHandlingAbstractTask<Any, Relationship, Exception, Any>(context) {
|
||||
override fun onExecute(params: Any): Relationship {
|
||||
val microBlog = MicroBlogAPIFactory.getInstance(context, accountKey)
|
||||
?: throw MicroBlogException("No account")
|
||||
|
@ -347,7 +347,11 @@ class AsyncTwitterWrapper(
|
|||
bus.post(FriendshipUpdatedEvent(accountKey, userKey, result))
|
||||
}
|
||||
|
||||
override fun onException(callback: Any?, exception: MicroBlogException) {
|
||||
override fun onException(callback: Any?, exception: Exception) {
|
||||
if (exception !is MicroBlogException) {
|
||||
Analyzer.logException(exception)
|
||||
return
|
||||
}
|
||||
DebugLog.w(TwidereConstants.LOGTAG, "Unable to update friendship", exception)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue