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);
|
Intent intent = new Intent(Intent.ACTION_EDIT);
|
||||||
Uri uri = Uri.fromFile(ignoreFile);
|
Uri uri = Uri.fromFile(ignoreFile);
|
||||||
intent.setDataAndType(uri, "text/plain");
|
intent.setDataAndType(uri, "text/plain");
|
||||||
|
intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
|
||||||
|
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.w(TAG, e);
|
Log.w(TAG, e);
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class FoldersAdapter extends ArrayAdapter<Folder> {
|
||||||
binding.openFolder.setOnClickListener(v -> {
|
binding.openFolder.setOnClickListener(v -> {
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||||
intent.setDataAndType(Uri.fromFile(new File(folder.path)), "resource/folder");
|
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) {
|
if (intent.resolveActivity(getContext().getPackageManager()) != null) {
|
||||||
getContext().startActivity(intent);
|
getContext().startActivity(intent);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue