0

I need your hrlp.Right now,I am struck in here. 1)My device does not have an sdcard. 2)In my app,I have MS files under my Internal Memory like ppt,xls and even pdf 3)I have quickoffice in my device. 4)When ever I launch a view intent using the appropriate Mime type ,I get the follwing error:

ERR/Quickoffice(15141): java.io.FileNotFoundException: /data/data/packagename/files/folder/something.pptx (Permission denied) 01965 ERR/Quickoffice(15141): at org.apache.harmony.luni.platform.OSFileSystem.openImpl(Native Method) ERR/Quickoffice(15141): at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:152) ERR/Quickoffice(15141): at java.io.FileInputStream.(FileInputStream.java:82) ERR/Quickoffice(15141): at java.io.FileInputStream.(FileInputStream.java:134) ERR/Quickoffice(15141): at android.content.ContentResolver.openInputStream(ContentResolver.java:300) ERR/Quickoffice(15141): at com.qo.android.quickcommon.OfficeActivity.a(Unknown Source) ERR/Quickoffice(15141): at com.qo.android.quickcommon.OfficeActivity.a(Unknown Source) ERR/Quickoffice(15141): at com.qo.android.quickword.Quickword.onCreate(Unknown Source) ERR/Quickoffice(15141): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1052) 01965 ERR/Quickoffice(15141): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) ERR/Quickoffice(15141): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 01965 ERR/Quickoffice(15141): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 01965 ERR/Quickoffice(15141): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 01965 ERR/Quickoffice(15141): at android.os.Handler.dispatchMessage(Handler.java:99) 01965 ERR/Quickoffice(15141): at android.os.Looper.loop(Looper.java:123) 01965 ERR/Quickoffice(15141): at android.app.ActivityThread.main(ActivityThread.java:4627) 01965 ERR/Quickoffice(15141): at java.lang.reflect.Method.invokeNative(Native Method) 01965 ERR/Quickoffice(15141): at java.lang.reflect.Method.invoke(Method.java:521) 01965 ERR/Quickoffice(15141): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858) 01965 ERR/Quickoffice(15141): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 01965 ERR/Quickoffice(15141): at dalvik.system.NativeStart.main(Native Method)

Is there any workaround/solution.Please suggest:)Thanks in advance

4

2 回答 2

0

您必须使用 ContentProvider 来访问内部存储中的文件。

于 2014-06-11T10:45:09.227 回答
0

包名中的文件只能由您的应用程序访问。如果您想在您的应用程序之外访问此文件,请将其写入某个共享位置,例如 getExternalStorageDirectory()。

于 2011-11-04T16:12:13.977 回答