2013-10-02 42 views
0

我在android中使用window.requestFileSystem。但它与错误代码9失败。我已阅读here与Android设备没有SD卡的问题。这是我正在使用的代码window.requestFileSystem在Android手机中失败

window.requestFileSystem(2, 0, function(file_system) { 
       console.log('got fs'); 
       callback(null, file_system); 
      }, function(err) { 
       console.log('not getting library fs'+err.code); 
       callback(err); 
      }); 

我该如何在android中使用它?

回答

0

根据官方文件,在requestFileSystem第一个参数应该是一个常数LocalFileSystem.PERSISTENTLocalFileSystem.TEMPORARY

尝试以下标准语句:

window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(f){ /* sucess */ }, function(e){ /* error */);