title: Saving file using Storage Access Framework in Android
body: <p>I am integrating the Document Access Framework with my cloud storage access app. 
  Using <a href="https://developer.android.com/guide/topics/providers/document-provider.html" rel="noreferrer">this</a> documentation I have been able to access the file and retrieve it (I simply use Gmail app's attach function to check this).</p>
  
  <p>I am now trying to find how to save file using the same method (Save file directly via the app to cloud storage) and I have done the following changes:</p>
  
  <p>For the getRoots call, </p>
  
  <pre><code>row.add(Root.COLUMN_FLAGS, Root.FLAG_SUPPORTS_CREATE);
  </code></pre>
  
  <p>and I have also overriden the <code>createDocument</code> method.</p>
  
  <p>I don't see much in ways of sample code or documentation on how to do this. I also see that a bunch of apps like the "Photos" app have "Share" button that use a different method (The logs show miniShareActivity) and my app does not show up in that (It looks like it is using a different filesharing mechanism)</p>
  
  <p>I am looking for information on </p>
  
  <ol>
  <li><p>How to use the SAF to store file (any sample file will be great or pointers to documentation). I Am assuming it will allow the user to use the picker interface to navigate to folder and store the file.</p></li>
  <li><p>How to get the app to show up in the "Minishare activity" list of apps to import the file into the app (It looks like it does not provide a picker interface but I still would like to provide the support so the file is saved to a default location) </p></li>
  </ol>