黑莓java.io.IOException异常无线电关闭 [英] Blackberry java.io.IOException radio is off

查看:199
本文介绍了黑莓java.io.IOException异常无线电关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我的设备连接到无线网络使用一个HTTP服务器。但我有此异常:

I am trying to connect my device to a http server using wifi. But I am having this exception:

java.io.IOException radio is off

什么一般是这个原因,我应该如何检查?

What is usually the cause of this and what should I check for?

感谢在前进。

推荐答案

我从来没有,所以我不能肯定有这个错误。然而,它听起来好像您的WiFi reciever被关闭,请尝试以下code。

I've never had this error so I can't be sure. However it sounds as if your wifi reciever is turned off, try the following code.

if (RadioInfo.getState() == RadioInfo.STATE_OFF) {
        if (Dialog.ask(Dialog.D_YES_NO, "You currently have no network connection\nDo you want to turn connections on?", Dialog.YES) == Dialog.YES)
        {
            //Activate GPRS
            Radio.activateWAFs(RadioInfo.WAF_3GPP);

            //Sleep for 10secs to allow wireless to activate. 
            // TODO (DG) DO THIS IN NEW THREAD TO PREVENT BLOCKING UI THREAD
            try {
                Thread.sleep(10000);
            }
            catch (InterruptedException e) {
                e.printStackTrace();
            }
        } }

这篇关于黑莓java.io.IOException异常无线电关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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