【问题标题】:Asynchronous service call while starting the activity in android在android中启动活动时的异步服务调用
【发布时间】:2010-07-24 20:04:34
【问题描述】:

我通过在意图中传递一些数据来从一个活动开始。我希望下一个活动使用来自意图的数据调用一些异步服务(休息服务)并在屏幕上显示结果。

我通过启动与 onStartup 方法不同的线程来进行异步调用。但这失败并出现以下错误:

: INFO/ProductAdvertisingAPIOperation(290): done requesting and parsing
: WARN/ActivityManager(73): Launch timeout has expired, giving up wake lock!
: INFO/Process(290): Sending signal. PID: 290 SIG: 9
: INFO/WindowManager(73): WIN DEATH: Window{43f64a28 com.zzzz.android.xxxx.main/com.zzzz.android.xxxx.main.HomeScreen paused=false}
: INFO/WindowManager(73): WIN DEATH: Window{43ffe9b8 com.zzzz.android.xxxx.main/com.zzzz.android.xxxx.main.CameraView paused=false}
: INFO/UsageStats(73): Unexpected resume of com.android.launcher while already resumed in com.zzzz.android.xxxx.main
: WARN/InputManagerService(73): Got RemoteException sending setActive(false) notification to pid 290 uid 10034

有人知道原因吗? 谢谢

【问题讨论】:

标签: android


【解决方案1】:

我将代码更改为不在 onCreate/onResume/OnStartup 中启动 aysnc 调用。似乎 Android 有一些 UI 线程超时 5 秒,超过它会抛出“应用程序无响应”消息。就我而言,它无法加载,因为这是在活动启动时发生的。所以我在活动启动后调用异步调用,onButtonclicked。

谢谢 奈恩

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-08-14
    • 2023-03-30
    • 2017-01-05
    • 1970-01-01
    • 2019-02-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多