05-16-2014 11:24 AM
I have an app that opens files and displays its content in the app. It works fine when I pick a file from the filebrowser inside the app (with filepicker).
It also works fine when I browse through the file browser of my blackberry and then click on a file. Then it also gets automatically opened via an InvokeRequest.
Now I also want to open a file from an attachment of an e-mail. But when I click on the attachment I get the message "No viewer available for 'filename'.
Does anyone know how I can tell my app to also open and display the file when I click on it as an e-mail attachment?
05-16-2014 01:29 PM
You need to register your app for invocation for that file type...
05-19-2014 09:41 AM
I did that. But I found some further information.
When I want to open a file from a folder of my blackberry I get the complete path from the uri.
When I select an file with the filepicker the uri gives me this:
m_uri = request.uri().toString();
output: m_uri = "file:///accounts/1000-enterprise/shared/documents
In this case I remove everything before "/shared..." and give this to my function which opens the file, reads it and presents the data in my app like it's supposed to. And with that path ("shared/documents/TestProtocoll.file") it opens the file properly.
But when I want to open a file directly by clicking on the attachment of an e-mail I get this directory
m_uri = "file:///accounts/1000-enterprise/invoke/de.my.app
If I give the complete string to my app of course it can't find the file. But when I do exactly the same as when I open a file by picking a file from the filebrowser it also doesn't open. By exactly the same I mean again removing "file:///account/1000-enterprise/" from the string.
Does anyone have an idea how I can give my app the correct path to a file opened from an attachment of an e-mail.
I gave the app permission to "Email and PIN Messages" in my bar-descriptor.xml". So it can't be a missing permission to read it, can it?