Browse Source

Accept magnet url's in Add screen.

pull/11/head
Eric Kok 13 years ago
parent
commit
5bfc629bf5
  1. 3
      android/src/org/transdroid/gui/Add.java

3
android/src/org/transdroid/gui/Add.java

@ -94,6 +94,8 @@ public class Add extends Activity {
return; 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 // Check URL structure
try { try {
new URL(urlText); // Nothing is actually done with it; only for parsing new URL(urlText); // Nothing is actually done with it; only for parsing
@ -101,6 +103,7 @@ public class Add extends Activity {
Toast.makeText(this, R.string.no_valid_url, Toast.LENGTH_SHORT).show(); Toast.makeText(this, R.string.no_valid_url, Toast.LENGTH_SHORT).show();
return; return;
} }
}
// Create a result for the calling activity // Create a result for the calling activity
Intent i = new Intent(this, Torrents.class); Intent i = new Intent(this, Torrents.class);

Loading…
Cancel
Save