DroidFish: Accept VIEW intent with mime type application/x-chess-fen.

This commit is contained in:
Peter Osterlund 2013-01-20 11:22:07 +00:00
parent b297eb1086
commit c3bcb9656f
2 changed files with 7 additions and 1 deletions

View File

@ -32,6 +32,11 @@
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/x-chess-pgn" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/x-chess-fen" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />

View File

@ -456,7 +456,8 @@ public class DroidFish extends Activity implements GUIInterface {
Intent intent = getIntent();
Uri data = intent.getData();
if (data == null) {
if (Intent.ACTION_SEND.equals(intent.getAction()) &&
if ((Intent.ACTION_SEND.equals(intent.getAction()) ||
Intent.ACTION_VIEW.equals(intent.getAction())) &&
("application/x-chess-pgn".equals(intent.getType()) ||
"application/x-chess-fen".equals(intent.getType())))
pgnOrFen = intent.getStringExtra(Intent.EXTRA_TEXT);