Android: How do I open a file from my app for editing in QuickOffice?

569 views Asked by At

Tested on Nexus 7 running Android 4.4 using QuickOffice 6.2.5.310b.

I have implemented a Storage Access Framework DocumentsProvider in my app, which now allows me to open and edit one of my app's files from QuickOffice. I would also like to be able to open and edit a file from within my app when I choose Open With, then choose QuickOffice. Is this possible?

In my app, when I click Open With on a file, I use ACTION_VIEW to open the file in another app. When I select QuickOffice, openFile() is invoked on my content provider with mode = "r". The file is opened in QuickOffice; however, the Save option is disabled, only Save as is enabled. I tried using ACTION_EDIT instead, but my content provider is still invoked with mode = "r" and Save is still disabled.

When I click Open from Google Drive or Open with from Box, the Save option is enabled.

Do I have to use a different action to open the file or change my content provider?

1

There are 1 answers

0
Jeff Sharkey On

Are you including Document.FLAG_SUPPORTS_WRITE in Document.COLUMN_FLAGS? Apps may use that to determine if writing is supported before actually trying to open with "w" mode.