Code to remove error in android studio
Asked
Active
Viewed 184 times
1 Answers
2
By your photo, you are using the wrong method.
You should place assignmenttitle.docx to /res/raw should not to /assets.
Since the file is within your application, you shouldn't use "file:///android_asset/assignmenttitle.docx".
This means the file path to Android Device storage, not the application's resource.
Instead, you should use like this!
Uri uri= Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + context.getPackageName() +
"/raw/assignmenttitle.docx");
or
InputStream ins = context.get().getResources().openRawResource(R.raw.assignmenttitle.docx);

Htin Linn Zaw
- 223
- 2
- 7
-
-
Hi bro, if my answer is useful for you, please accept my answer. – Htin Linn Zaw Jan 11 '20 at 01:11