mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-23 19:34:08 +01:00
DroidFish: Handle Intent.EXTRA_STREAM of type "file".
This commit is contained in:
parent
fdb4d70cbb
commit
9e7572d54c
|
@ -489,6 +489,20 @@ public class DroidFish extends Activity implements GUIInterface {
|
|||
try {
|
||||
Intent intent = getIntent();
|
||||
Uri data = intent.getData();
|
||||
if (data == null) {
|
||||
Bundle b = intent.getExtras();
|
||||
if (b != null) {
|
||||
Object strm = b.get(Intent.EXTRA_STREAM);
|
||||
if (strm instanceof Uri) {
|
||||
data = (Uri)strm;
|
||||
if ("file".equals(data.getScheme())) {
|
||||
filename = data.getEncodedPath();
|
||||
if (filename != null)
|
||||
filename = Uri.decode(filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (data == null) {
|
||||
if ((Intent.ACTION_SEND.equals(intent.getAction()) ||
|
||||
Intent.ACTION_VIEW.equals(intent.getAction())) &&
|
||||
|
|
Loading…
Reference in New Issue
Block a user