mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-12-18 06:51:17 +01:00
Remove support for ACTION_GET_CONTENT
As we have a document provider now we can remove ACTION_GET_CONTENT. "The ACTION_OPEN_DOCUMENT intent is only available on devices running Android 4.4 and higher. If you want your application to support ACTION_GET_CONTENT to accommodate devices that are running Android 4.3 and lower, you should disable the ACTION_GET_CONTENT intent filter in your manifest for devices running Android 4.4 or higher. A document provider and ACTION_GET_CONTENT should be considered mutually exclusive. If you support both of them simultaneously, your app will appear twice in the system picker UI, offering two different ways of accessing your stored data. This would be confusing for users." - http://developer.android.com/guide/topics/providers/document-provider.html#43
This commit is contained in:
parent
fc15bd2355
commit
6e7f777d04
6 changed files with 8 additions and 217 deletions
|
|
@ -23,6 +23,13 @@ import java.util.LinkedList;
|
|||
/**
|
||||
* A document provider for the Storage Access Framework which exposes the files in the
|
||||
* $HOME/ folder to other apps.
|
||||
* <p>
|
||||
* Note that this replaces providing an activity matching the ACTION_GET_CONTENT intent:
|
||||
* <p>
|
||||
* "A document provider and ACTION_GET_CONTENT should be considered mutually exclusive. If you
|
||||
* support both of them simultaneously, your app will appear twice in the system picker UI,
|
||||
* offering two different ways of accessing your stored data. This would be confusing for users."
|
||||
* - http://developer.android.com/guide/topics/providers/document-provider.html#43
|
||||
*/
|
||||
public class TermuxDocumentsProvider extends DocumentsProvider {
|
||||
|
||||
|
|
@ -173,7 +180,7 @@ public class TermuxDocumentsProvider extends DocumentsProvider {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the file given a document id (the reverse of {@link #getFileForDocId(String)}).
|
||||
* Get the file given a document id (the reverse of {@link #getDocIdForFile(File)}).
|
||||
*/
|
||||
private static File getFileForDocId(String docId) throws FileNotFoundException {
|
||||
final File f = new File(docId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue