Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Intent createYoutubeIntent(MovieBean movie) {
- Builder youtubeUri = new Builder();
- youtubeUri.scheme("http");
- youtubeUri.authority("m.youtube.com");
- youtubeUri.path("results");
- youtubeUri.appendQueryParameter("q", new StringBuilder("\"").append(movie.getMovieName()).append("\" trailer").toString());
- StringBuilder youtubeUriStr = new StringBuilder("http://m.youtube.com/results?q=");
- youtubeUriStr.append(new StringBuilder("\"").append(Uri.encode(movie.getMovieName())).append("\"+trailer").toString());
- Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(youtubeUriStr.toString()));
- return myIntent;
- }
Add Comment
Please, Sign In to add comment