Questions tagged [android-fileprovider]

FileProvider is an extension of Android's ContentProvder class, which supports easy sharing of private files between apps.

FileProvider supports easy sharing of private files between Android apps. When paired with features like grantUriPermission(String, Uri, int) or FLAG_GRANT_READ_URI_PERMISSION, this provider ensures that receiving apps can always open the underlying file.

Apps should generally avoid sending raw filesystem paths across process boundaries, since the receiving app may not have the same access as the sender. Instead, apps should send Uri backed by a provider like FileProvider.

Resources:

679 questions
-2
votes
1 answer

java.lang.IllegalArgumentException: Failed to find configured root that contains /file:/

I am trying to open the file downloaded by DownloadManager. I registered a BroadcastReceiver with action DownloadManager.ACTION_DOWNLOAD_COMPLETE. Here's the onReceive method of my receiver- try { DownloadManager dm = (DownloadManager)…
Rishav Agarwal
  • 96
  • 1
  • 11
-2
votes
2 answers

IllegalArgumentException error on storing images in external directory

I want to click a picture and store it in the external storage directory. For that, I am using this: public class MainActivity extends AppCompatActivity { Button btn_pic; ImageView iv_pic; Context ctx = this; Bitmap photo, bm; String photoPath,…
Mayank Aggarwal
  • 169
  • 1
  • 15
-3
votes
2 answers

java.lang.IllegalArgumentException: Failed to find configured root that contains

This is my code block: notificationIntent.setDataAndType(FileProvider.getUriForFile( context, "TrySomething",new File(context.getFilesDir().getAbsolutePath() + "/update_file") ),ANDROID_PACKAGE); And this is my XML…
-5
votes
1 answer

Explanation for a simple "saving the file" code

I want to learn more about Android apps. So, I want an explanation of the out=context.openFileOutput arguments . public void saveImage(Context context, Bitmap b,String name,String extension){ name=name+"."+extension; FileOutputStream out; try { …
1 2 3
45
46