01-04-2013 03:27 PM
I'm trying to use the invoked framework with images but when I get the URI and try to read the file using the webworks file utilitis I get an error that the file cannot be found. Any tips hints our there, has anyone else tried this?
<feature id="blackberry.invoke" />
<rim:invoke-target id="com.chilisabls.bb.memegenerator.creatememe">
<type>APPLICATION</type>
<filter>
<action>bb.action.VIEW</action>
<action>bb.action.OPEN</action>
<mime-type>image/png</mime-type>
<mime-type>image/jpeg</mime-type>
<property var="uris" value="file://,data://local"/>
</filter>
</rim:invoke-target>
blackberry.event.addEventListener("invoked", function (invocationInfo){
blackberry.io.sandbox = false;
function initFS(fs){
fs.root.getFile(invocationInfo.uri, {}, function(fileEntry) {
var reader = new FileReader();
reader.onload = function(e) {
bb.pushScreen('memecreator.htm', 'memecreator', {img: e.target.result});
};
reader.onerror = function() {
var a="bnasdf";
};
reader.readAsDataURL(fileEntry);
}, errorHandler);
}
window.requestFileSystem(window.PERSISTENT, 5*1024*1024, initFS, errorHandler);
});