Fixed
Status Update
Comments
uc...@google.com <uc...@google.com> #2
Found suddenly that this process has run for 3 hours !!
Shouldn't AS tell me that another builds was going on ?
By the way, it has never run for 3 hours before...
RG
Shouldn't AS tell me that another builds was going on ?
By the way, it has never run for 3 hours before...
RG
tn...@google.com <tn...@google.com> #3
Thinking back for three hours, I may have tried to stop the build process by clicking on the gray x behind "Gradle bulding..." message on the AS status bar. All seemed OK then...
RG
RG
mm...@commonsware.com <mm...@commonsware.com> #4
FYI theese are the AS related applications running during theese hours...
Description
Uri uri=FileProvider.getUriForFile(mContext, BuildConfig.APPLICATION_ID + ".fileprovider", output);
Intent myIntent = new Intent(Intent.ACTION_VIEW, uri);
myIntent.setType("text/plain");
myIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivity(myIntent);
This will cause problems for the *receiving* app, because setType() wipes out the Uri set in the constructor, and so the text editor app will get a null Uri and probably will not handle that especially well.
Ideally, there would be a Lint warning for this scenario: supplying a Uri to an Intent prior to a setType() call on that Intent. At present, neither Lint nor Android Studio inspections point out this problem. The recommended solution would be to use setDataAndType(), supplying the Uri and MIME type in one fell swoop.
(for whatever a "fell swoop" is...)
FWIW, the same basic issue was reported five years ago and was ignored for three years:
Thanks for considering this!