Commit 1c767207 authored by Albert Vaca Cintora's avatar Albert Vaca Cintora

Detect shared youtube videos and open them in a browser instead of as text

parent e4d683f2
......@@ -157,6 +157,15 @@ public class ShareToReceiver extends ActionBarActivity {
} else if (extras.containsKey(Intent.EXTRA_TEXT)) {
String text = extras.getString(Intent.EXTRA_TEXT);
String subject = extras.getString(Intent.EXTRA_SUBJECT);
if (subject != null && subject.endsWith("YouTube")) {
int index = text.indexOf(": http://youtu.be/");
if (index > 0) {
text = text.substring(index+2); //Skip ": "
}
}
boolean isUrl;
try {
new URL(text);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment