mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-04-02 10:20:45 +02: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 {
|
try {
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
Uri data = intent.getData();
|
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 (data == null) {
|
||||||
if ((Intent.ACTION_SEND.equals(intent.getAction()) ||
|
if ((Intent.ACTION_SEND.equals(intent.getAction()) ||
|
||||||
Intent.ACTION_VIEW.equals(intent.getAction())) &&
|
Intent.ACTION_VIEW.equals(intent.getAction())) &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user