Created
October 15, 2013 04:31
-
-
Save Krylez-zz/6986506 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class YTUrlActivity extends Activity { | |
private static final String YOUTUBE = "http://www.youtube.com/watch?v=%s"; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
String uriString = String.format(YOUTUBE, getIntent().getData().getLastPathSegment()); | |
Intent intent = new Intent(); | |
intent.setData(Uri.parse(uriString)); | |
startActivity(intent); | |
finish(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment