1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2025-01-04 06:23:04 +00:00

Workaround text/xml not handled correctly on some devices

http://forum.xda-developers.com/showpost.php?p=65045187&postcount=1074
This commit is contained in:
M66B 2016-01-29 19:01:04 +01:00
parent 245afe91ea
commit fc936bc546

View file

@ -607,7 +607,7 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
private static Intent getIntentCreateExport() { private static Intent getIntentCreateExport() {
Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT); Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE); intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("text/xml"); intent.setType("*/*"); // text/xml
intent.putExtra(Intent.EXTRA_TITLE, "netguard_" + new SimpleDateFormat("yyyyMMdd").format(new Date().getTime()) + ".xml"); intent.putExtra(Intent.EXTRA_TITLE, "netguard_" + new SimpleDateFormat("yyyyMMdd").format(new Date().getTime()) + ".xml");
return intent; return intent;
} }
@ -615,14 +615,14 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
private static Intent getIntentOpenExport() { private static Intent getIntentOpenExport() {
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE); intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("text/xml"); intent.setType("*/*"); // text/xml
return intent; return intent;
} }
private static Intent getIntentOpenHosts() { private static Intent getIntentOpenHosts() {
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE); intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("*/*"); intent.setType("*/*"); // text/plain
return intent; return intent;
} }