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

Java Development

Reply
New Developer
saran_karma
Posts: 8
Registered: ‎12-28-2011
My Device: BlackBerry® Bold™ 9900
My Carrier: Etisalat

ControlledAccessException when using FilePicker.show()

Hi,

 

I am getting ControlledAccessException  while select video/music file from the FilePicker.  My code based on OS 6 API.

 

Details ::

I have Screen with button called Preview Media once user clicked, popup window gives option to select PICTURE, VIDEO, VOICE NOTES. I am using FilePicker to pick the filename from media library. It works as below,

 

1. FilePicker.VIEW_PICTURES    => User able to see the file list & able to click the file => My Perview screen works well.

 

2. FilePicker.VIEW_VIDEOS  => User able to see the file list but while click any video file getting ControlledAccessException 


3. FilePicker.VIEW_VOICE_NOTES => User able to see the file list but while click any AMR file getting ControlledAccessException

 

I have tried to catch the exception but no help, I used as below,

 

filePicker.setView(FilePicker.VIEW_VIDEOS);

synchronized(Application.getEventLock()) {
try{
filePicker.show();
} catch(Exception e) { }

}

fileName = fileListener.getSelectedFile();

 

Please help on this, Thanks in advance.


Please use plain text.
New Developer
saran_karma
Posts: 8
Registered: ‎12-28-2011
My Device: BlackBerry® Bold™ 9900
My Carrier: Etisalat

Re: ControlledAccessException when using FilePicker.show()

[ Edited ]

 Adding more info related to the above post,

 

The above issues not there while testing from Simulator and it occurs only in real device. I am testing with BlackBerry® Bold™ 9900 device.

 

And I have tried with the below code in app but no help, still getting same error.

 

ApplicationPermissions appPermissions = new ApplicationPermissions();
appPermissions.addPermission(ApplicationPermissions.PERMISSION_RECORDING);
appPermissions.addPermission(ApplicationPermissions.PERMISSION_MEDIA);
ApplicationPermissionsManager.getInstance().invokePermissionsRequest( appPermissions );


Please use plain text.
Developer
pbrebs
Posts: 40
Registered: ‎09-08-2011
My Device: 8900
My Carrier: AIS

Re: ControlledAccessException when using FilePicker.show()

You've not given a reason to be using synchronized() - try without.

Please use plain text.
New Developer
saran_karma
Posts: 8
Registered: ‎12-28-2011
My Device: BlackBerry® Bold™ 9900
My Carrier: Etisalat

Re: ControlledAccessException when using FilePicker.show()

 

I have tried without synchronized() too. One of post I read to use with synchronized()  and another post I read to use try...catch so I have tried all combinations. but no help.

Please use plain text.