Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Runtime Development

Reply
New Contributor
anmipo
Posts: 7
Registered: ‎12-18-2012
My Device: PlayBook

File selection dialog broken in 10.2.1

I am maintaining a ported Android app which uses BB10 native file selection dialog via ACTION_GET_CONTENT intent. The code is as follows (error handling not shown for clarity):

Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("file/*");
startActivityForResult(intent, MY_REQUEST_CODE);

 
The result is then processed here:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
    super.onActivityResult(requestCode, resultCode, intent);
    if (requestCode == MY_REQUEST_CODE && resultCode == RESULT_OK) {
        fileName = intent.getData().getPath();
        // ...some further processing
    }
}

 

This works fine in BB 10.2.0.415 and earlier. However, in 10.2.1.1259, the resultCode is always RESULT_CANCELED and intent is always null - even if a file has actually been selected.

Is this a bug in the system, or am I missing something?

Retired
mwhiteman
Posts: 159
Registered: ‎11-21-2008
My Device: BlackBerry 10

Re: File selection dialog broken in 10.2.1

Hello,

 

Have you tried on the GOLD release of BlackBerry 10.2.1? This would be build 1925. You can grab autoloaders or the simulator from here:

 

https://developer.blackberry.com/blackberry10devalpha/devalpha_update.html

https://developer.blackberry.com/devzone/develop/simulator/simulator_installing.html

Matt Whiteman
Product Manager, Android, BlackBerry Java & Simulators
New Contributor
anmipo
Posts: 7
Registered: ‎12-18-2012
My Device: PlayBook

Re: File selection dialog broken in 10.2.1

Thank you for the reply, Matt.

 

Unfortunately, the problem remains in simulator with 10.2.1.1925.

 

Further testing showed that the issue seems to be folder-specific: the code works as expected if the user picks a file from Device/camera, Device/music, Device/videos (although they return content:// URIs instead of file names as before); file selection from Device/downloads also works as expected/as before.

 

For files in other folders, the problem remains: anything selected from devices's documents, books, or misc (or their subfolders) leads to RESULT_CANCELLED with null data as described in my previous post...

New Contributor
anmipo
Posts: 7
Registered: ‎12-18-2012
My Device: PlayBook

Re: File selection dialog broken in 10.2.1

It's been 7 weeks already. Any updates on the issue, Blackberry?