1

I am using the integrated API for file picker in Andoid like so:

Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("*/*");

startActivityForResult(intent, 42);

Everything is fine when it comes to functionality but the color of the bar of this default activity is BLUE and I was wondering how can I change it?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Sorah Al
  • 11
  • 1

1 Answers1

0

Since file picker is another application(app name: Files package name: com.android.documentsui), I think that it is impossible to change the color of toolbar as far as I know. However, I think that you can implement the file picker function yourself in your app. In that case it's your own application so it's free to change the color of the toolbar.

ysys
  • 82
  • 4
  • 1
    hmmm I can't find some sample code someone doing this? – Sorah Al Mar 10 '19 at 13:26
  • I think that it is a common way to [use the storage access framework](https://developer.android.com/guide/topics/providers/document-provider), so I believe that transitioning to Activity of a different tool bar color is not a behavior that makes users feel strange. Based on that, if you create your own File Picker, you will need to create it with UI, so I think that it is not easy. I have not tried but I could find such [a library](https://github.com/jaiselrahman/FilePicker). There were also very [old ones](https://stackoverflow.com/questions/2701857/android-file-picker). – ysys Mar 10 '19 at 16:14