Code example for Uri.Builder

Methods: appendQueryParameter, authority, path, scheme

1
		Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(callUri.toString()));
		return myIntent;
	} 
 
	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;
	} 
 
	public static Intent createTrailerIntent(YoutubeBean trailer) {
		Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(trailer.getUrlVideo()));
		return myIntent;
	}