mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-12-23 11:21:29 +00:00
Grant write permission when sharing stignore file
This commit is contained in:
parent
fa49c796ae
commit
a7742103e1
2 changed files with 3 additions and 1 deletions
|
@ -187,6 +187,8 @@ public class FolderActivity extends SyncthingActivity
|
|||
Intent intent = new Intent(Intent.ACTION_EDIT);
|
||||
Uri uri = Uri.fromFile(ignoreFile);
|
||||
intent.setDataAndType(uri, "text/plain");
|
||||
intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
|
||||
|
||||
startActivity(intent);
|
||||
} catch (IOException e) {
|
||||
Log.w(TAG, e);
|
||||
|
|
|
@ -53,7 +53,7 @@ public class FoldersAdapter extends ArrayAdapter<Folder> {
|
|||
binding.openFolder.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setDataAndType(Uri.fromFile(new File(folder.path)), "resource/folder");
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
if (intent.resolveActivity(getContext().getPackageManager()) != null) {
|
||||
getContext().startActivity(intent);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue