<NME> ImportGpxZipAttachmentThread.java
<BEF> package cgeo.geocaching.files;

import cgeo.geocaching.utils.CancellableHandler;
import cgeo.geocaching.utils.Log;

import android.content.ContentResolver;
import android.net.Uri;
import android.os.Handler;

import java.io.IOException;
import java.io.InputStream;

class ImportGpxZipAttachmentThread extends AbstractImportGpxZipThread {
    private final Uri uri;
    private final ContentResolver contentResolver;

    ImportGpxZipAttachmentThread(final Uri uri, final ContentResolver contentResolver, final int listId, final Handler importStepHandler, final DisposableHandler progressHandler) {
        super(listId, importStepHandler, progressHandler);
        this.uri = uri;
        this.contentResolver = contentResolver;
        Log.i("Import zipped GPX from uri: " + uri);
    }

    @Override
    protected InputStream getInputStream() throws IOException {
        return contentResolver.openInputStream(uri);
    }

    @Override

<MSG> Import of downloadable PocketQueries #4267

Parsing of download PQ Table and offer to import PQ in PocketQueryList if downloadable.

<DFF> @@ -1,5 +1,6 @@
 package cgeo.geocaching.files;
 
+import cgeo.geocaching.network.Network;
 import cgeo.geocaching.utils.CancellableHandler;
 import cgeo.geocaching.utils.Log;
 
@@ -7,6 +8,7 @@ import android.content.ContentResolver;
 import android.net.Uri;
 import android.os.Handler;
 
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 
@@ -23,7 +25,16 @@ class ImportGpxZipAttachmentThread extends AbstractImportGpxZipThread {
 
     @Override
     protected InputStream getInputStream() throws IOException {
-        return contentResolver.openInputStream(uri);
+        try {
+            return contentResolver.openInputStream(uri);
+        } catch (final FileNotFoundException e) {
+            // for http links, we may need to download the content ourself, if it has no mime type announced by the browser
+            if (uri.toString().startsWith("http")) {
+                return Network.getResponseStream(Network.getRequest(uri.toString()));
+            }
+        }
+        Log.e("GpxZip import cannot resolve " + uri);
+        return null;
     }
 
     @Override

Import of downloadable PocketQueries #4267