Skip to content

finishAllActivitiesExceptNewest #36

Description

@fail572872916

核心错误路径是:

您的代码在网络请求成功后,通过 StringCallback.toLogin() 尝试执行一个操作,要求返回登录界面。

为了实现这个操作,您的代码调用了 com.dylanc.longan 库中的 ActivityKt.finishAllActivitiesExceptNewest()。

该函数内部又调用了 ActivityKt.getTopActivity()。

getTopActivity() 函数尝试从一个内部维护的 Activity 列表中获取最后一个元素,使用了 kotlin.collections.CollectionsKt.last() 这个函数。

last() 函数会检查列表是否为空。如果列表是空的,它会抛出 NoSuchElementException (或者在 Android/Kotlin 环境下表现为 RuntimeException 包装的 NoSuchElementException 或 IndexOutOfBoundsException),从而导致崩溃。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions