diff --git a/android/src/org/transdroid/gui/Add.java b/android/src/org/transdroid/gui/Add.java index fe06d262..ad26ffbd 100644 --- a/android/src/org/transdroid/gui/Add.java +++ b/android/src/org/transdroid/gui/Add.java @@ -94,12 +94,15 @@ public class Add extends Activity { return; } - // Check URL structure - try { - new URL(urlText); // Nothing is actually done with it; only for parsing - } catch (MalformedURLException e) { - Toast.makeText(this, R.string.no_valid_url, Toast.LENGTH_SHORT).show(); - return; + // Magnet scheme is not supported by java.net.URL so instead we consider this to be okay manually + if (urlText != null && !urlText.startsWith("magnet")) { + // Check URL structure + try { + new URL(urlText); // Nothing is actually done with it; only for parsing + } catch (MalformedURLException e) { + Toast.makeText(this, R.string.no_valid_url, Toast.LENGTH_SHORT).show(); + return; + } } // Create a result for the calling activity