mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-02-17 09:37:50 +01:00
DroidFish: Handle PGN intents with scheme "file".
This commit is contained in:
parent
1c1640d73c
commit
b97303fd5b
|
@ -254,7 +254,9 @@ public class DroidFish extends Activity implements GUIInterface {
|
|||
String pgn = null;
|
||||
try {
|
||||
Intent intent = getIntent();
|
||||
if ((intent.getData() != null) && intent.getScheme().equals("content")) {
|
||||
if (intent.getData() != null) {
|
||||
if ("content".equals(intent.getScheme()) ||
|
||||
"file".equals(intent.getScheme())) {
|
||||
ContentResolver resolver = getContentResolver();
|
||||
InputStream in = resolver.openInputStream(intent.getData());
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
@ -267,6 +269,7 @@ public class DroidFish extends Activity implements GUIInterface {
|
|||
}
|
||||
pgn = sb.toString();
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
Toast.makeText(getApplicationContext(), R.string.failed_to_read_pgn_data,
|
||||
Toast.LENGTH_SHORT).show();
|
||||
|
|
Loading…
Reference in New Issue
Block a user