06-23-2012 12:23 PM
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.
06-23-2012 12:28 PM - edited 06-23-2012 12:33 PM
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(ApplicationPermission
appPermissions.addPermission(ApplicationPermission
ApplicationPermissionsManager.getInstance().invoke
06-24-2012 11:56 AM
You've not given a reason to be using synchronized() - try without.
06-24-2012 12:04 PM
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.