mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-27 14:15:16 +01:00
DroidFish: Add support for intent.action.SEND with mimeType application/x-chess-pgn. Suggested by Gerhard Kalab.
This commit is contained in:
parent
25aa40a30f
commit
3fb9c1aca7
|
@ -27,7 +27,12 @@
|
|||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="application/x-chess-pgn" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="application/x-chess-pgn" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".activities.Preferences"
|
||||
android:label="@string/preferences">
|
||||
</activity>
|
||||
|
|
|
@ -436,7 +436,11 @@ public class DroidFish extends Activity implements GUIInterface {
|
|||
try {
|
||||
Intent intent = getIntent();
|
||||
Uri data = intent.getData();
|
||||
if (data != null) {
|
||||
if (data == null) {
|
||||
if (Intent.ACTION_SEND.equals(intent.getAction()) &&
|
||||
"application/x-chess-pgn".equals(intent.getType()))
|
||||
pgn = intent.getStringExtra(Intent.EXTRA_TEXT);
|
||||
} else {
|
||||
String scheme = intent.getScheme();
|
||||
if ("file".equals(scheme)) {
|
||||
filename = data.getEncodedPath();
|
||||
|
|
Loading…
Reference in New Issue
Block a user