如何使FilePicker在某些BlackBerry手机上正常工作? [英] How can I get FilePicker working properly on certain BlackBerry handsets?

查看:90
本文介绍了如何使FilePicker在某些BlackBerry手机上正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在我的应用程序中实现Filepicker,以允许用户从手机中选择照片.我正在使用的代码如下:

I'm implementing a Filepicker in my app to allow users to choose photos from their phones. The code I'm using is as follows:

呼叫Filepicker:

try
{
        UiApplication.getUiApplication().invokeLater(new Runnable()
        {
        public void run()
        {
             FilePicker fp = FilePicker.getInstance();
             fileListener = new FilePickListener();
             fp.setListener(fileListener);
             fp.show();
         }
             });
         }
        catch (Exception e)
        {
             UiApplication.getUiApplication().invokeLater(new Runnable()
             {
                 public void run()
                 {
                      Dialog.alert("Please check your data card..");
                 }
            });
        }

以及在我的FilePickListener:

public void selectionDone(String str)
{       
    this.currFileName = str;

    int index = str.lastIndexOf('/');
    Dialog.alert("Filename: "+str.substring(index+1).trim());
}

这在我尝试过的大多数手机中都可以完美运行(这些手机既有运行OS5的手机,也有运行OS6的手机的混合物).但是在某些情况下,例如8900(正在运行OS v5.0.0.411),它无法正常工作.该被调用并显示,但是当任何文件被选中,selectionDone方法不会被调用.我已经在两个单独的8900上进行了测试,并且都存在相同的问题.

This works perfectly in most handsets that I've tried it on (which have been a mix of handsets with some running OS5 and some running OS6). But on some, like the 8900 (running OS v5.0.0.411) it doesn't work properly. The Filepicker gets called and appears, but when any file gets selected, the selectionDone method doesn't get called. I've tested it on two separate 8900s and both have the same problem.

有人知道为什么它可以在某些手机而不是其他手机上使用吗?

Does anyone have an idea why it works on certain handsets and not other?

推荐答案

您是已知的RIM问题的受害者: FilePicker引发ControlledAccessException .

You are a victim of a known RIM issue: FilePicker throws ControlledAccessException.

该问题被标记为已修复".但是,没有有关他们修复该操作系统版本的信息. (很难说出这样有用的信息吗?)

The issue is marked as "Fixed". However there is no info in which OS version they fixed it. (Is it so difficult to tell such a useful info?)

但是从评论到问题:

我们在Bold 9700上遇到了与OS 5.0.0.321相同的问题.但是,此问题在OS 5.0.0.464上没有出现

We experience the very same issue with OS 5.0.0.321 on a Bold 9700. However, the issue does NOT appear on OS 5.0.0.464

所以我想他们会在OS 5.0.0.464中修复它.但这还不是终点-在OS 6中FilePicker 再次出现在OS 6的早期版本中.结论-只是不要使用它.使用自定义文件浏览器屏幕选择文件. SDK 4.7.0中有一个名为FileExplorerDemo的示例,请检查该示例以获取实施详细信息.

so my guess would be they fixed it in OS 5.0.0.464. But that's not the end - in OS 6 FilePicker appears broken in early versions of OS 6 again. The conclusion - just don't use it. Use a custom file browser screen to pick a file. There is a sample in SDK 4.7.0 named FileExplorerDemo, check it for implementation details.

这篇关于如何使FilePicker在某些BlackBerry手机上正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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