mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-23 11:31:33 +01:00
DroidFish: Made sharing games from ChessBase app work.
This commit is contained in:
parent
3fa87c01eb
commit
558a4abcea
|
@ -693,7 +693,7 @@ public class DroidFish extends Activity
|
|||
"application/x-chess-fen".equals(intent.getType())))
|
||||
pgnOrFen = intent.getStringExtra(Intent.EXTRA_TEXT);
|
||||
} else {
|
||||
String scheme = intent.getScheme();
|
||||
String scheme = data.getScheme();
|
||||
if ("file".equals(scheme)) {
|
||||
filename = data.getEncodedPath();
|
||||
if (filename != null)
|
||||
|
@ -703,7 +703,7 @@ public class DroidFish extends Activity
|
|||
("content".equals(scheme) ||
|
||||
"file".equals(scheme))) {
|
||||
ContentResolver resolver = getContentResolver();
|
||||
InputStream in = resolver.openInputStream(intent.getData());
|
||||
InputStream in = resolver.openInputStream(data);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
while (true) {
|
||||
byte[] buffer = new byte[16384];
|
||||
|
|
|
@ -262,6 +262,8 @@ public class DroidChessController {
|
|||
|
||||
/** Parse a string as FEN or PGN data. */
|
||||
public final synchronized void setFENOrPGN(String fenPgn) throws ChessParseError {
|
||||
if (!fenPgn.isEmpty() && fenPgn.charAt(0) == '\ufeff')
|
||||
fenPgn = fenPgn.substring(1); // Remove BOM
|
||||
Game newGame = new Game(gameTextListener, game.timeController.tcData);
|
||||
try {
|
||||
Position pos = TextIO.readFEN(fenPgn);
|
||||
|
|
Loading…
Reference in New Issue
Block a user