黑莓手机 - 未捕获的异常:应用程序没有响应;进程终止 [英] BlackBerry - Uncaught exception: Application is not responding; process terminated

查看:359
本文介绍了黑莓手机 - 未捕获的异常:应用程序没有响应;进程终止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发使用Eclipse的插件黑莓应用程序,使对Web服务的调用时,当我部署我的应用程序到生产服务器和手机我收到以下错误......它在我的本地艺术作品模拟器和开发环境。 (我不能直接勾我的模拟器来我的生产环境)

I'm developing an application using the Blackberry plugin for eclipse and I am getting the following error when making a call to a web service when I have deployed my application to a production server and handset... it works in my local simulator and development environment. (I can't hook my simulator directly to my production environment)

未捕获的异常:应用程序
  应用程序(150)没有响应;处理
  终止

Uncaught exception: Application app(150) is not responding; process terminated

呼叫正在从另一个线程的。

The call is being made from another thread.

线程传递给我的CustomThreadManager运行

The thread is passed to my CustomThreadManager to run

ClientChangeThread thread = new ClientChangeThread();
CustomThreadManager.Start(thread, true);

CustomThreadManager

CustomThreadManager

ProgressPopup _progress = null; 
    if(showProgress){
        _progress = new ProgressPopup("Loading...");
        _progress.Open();
    }
    thread.start();             

    while (thread.isRunning())
    {
        try
        {
            CustomThread.sleep(300);
            if(showProgress){
                _progress.doPaint();
            }
        }
        catch (InterruptedException e)
        {
            Dialog.alert("Error contacting webservice\n" + e.getMessage());
            Functions.moveBack();
        }                   
    }
    if(showProgress)
        _progress.Close();

一些调用,而有些不。
Web服务将返回结果很快使林不知道如果Web服务太慢或与线程问题。

Some calls work while others dont. The web service returns results fairly quickly so Im not sure if its the web service is too slow or problems with the threading.

任何帮助AP preciated。

Any help appreciated.

推荐答案

。睡眠()不会释放任何锁。这意味着你的code,以更新while循环进度条是抱着UI事件锁定和prevents其他UI更新情况的发生,直到while循环终止 - 在这种情况下thread.isRunning时()返回false。

Thread.sleep() does not release any locks. This means your code to update the progress bar in the while-loop is holding the UI event lock, and prevents other UI updates from happening until the while loop terminates -- in this case when thread.isRunning() returns false.

您可以使用 UiApplication.invokeLater(Runnable接口,长,布尔)来安排,而Runnable的执行时,将只头筹锁重复UI更新。

You can use UiApplication.invokeLater(Runnable, long, boolean) to schedule a repeating UI update that will only hold the event lock while the Runnable is executing.

这篇关于黑莓手机 - 未捕获的异常:应用程序没有响应;进程终止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆