For some technical reasons, I cannot use the Android File Picker to get the file and their contents in my application. This is why I came up with a solution that requests intent and processes the results in my own interface.
Here is how I get a list of applications with Intent.ACTION_GET_CONTENT
Intent documentIntent = new Intent(Intent.ACTION_GET_CONTENT);
documentIntent.setType((action == ACTION_SELECT_FILE) ? "*/*" : "image/*");
List<ResolveInfo> appList = getActivity().getPackageManager().queryIntentActivities(documentIntent, PackageManager.MATCH_DEFAULT_ONLY);
This works great and lists applications that can handle my request.
But I work with Android for Work , and when I execute the above code, I get a list of applications available for the Work Profile , which is expected.
But one of the results that comes back from the above code is “Switch to personal” , which lists the applications installed in the Personal account in Android File Picker .
So the question is, how can I get the same behavior? How can I request actions for a specific action?
source
share