File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
src/com/owncloud/android/ui/activity Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 2323import android .content .Intent ;
2424import android .net .Uri ;
2525import android .os .AsyncTask ;
26+ import android .os .Build ;
2627import android .os .Bundle ;
2728import android .support .v4 .app .Fragment ;
2829import android .support .v4 .app .FragmentManager ;
2930import android .support .v4 .app .FragmentTransaction ;
31+ import android .support .v4 .content .FileProvider ;
3032import android .view .MenuItem ;
3133import android .view .View ;
3234import android .view .View .OnClickListener ;
@@ -148,11 +150,18 @@ private void sendMail() {
148150 ArrayList <Uri > uris = new ArrayList <Uri >();
149151
150152 // Convert from paths to Android friendly Parcelable Uri's
151- for (String file : Log_OC .getLogFileNames ())
152- {
153+ for (String file : Log_OC .getLogFileNames ()) {
153154 File logFile = new File (mLogPath , file );
154155 if (logFile .exists ()) {
155- uris .add (Uri .fromFile (logFile ));
156+ if (Build .VERSION .SDK_INT < Build .VERSION_CODES .N ) {
157+ uris .add (Uri .fromFile (logFile ));
158+ } else {
159+ uris .add (FileProvider .getUriForFile (
160+ this ,
161+ getString (R .string .file_provider_authority ),
162+ logFile
163+ ));
164+ }
156165 }
157166 }
158167
You can’t perform that action at this time.
0 commit comments