Code example for URL

Methods: toExternalForm

0
	 */ 
	public static Intent shareLinkChooserIntent(String subj, URL link, String title) {
		Intent i = new Intent(Intent.ACTION_SEND);
		i.setType("text/plain");
		i.putExtra(Intent.EXTRA_SUBJECT, subj);
		i.putExtra(Intent.EXTRA_TEXT, link.toExternalForm());
		Intent chooser = Intent.createChooser(i, title);
		return chooser;
	} 
 
	/** 
	 * Generates a generic chooser Intent for sharing links and returns it back 
	 * @param subj subject for the share 
	 * @param link link to be shared 
	 * @param title title of the created chooser intent 
	 * @return the desired intent using which one can 'startActivity' 
	 */ 
	public static Intent shareLinkChooserIntent(String subj, String link, String title) {
		Intent i = new Intent(Intent.ACTION_SEND);
		i.setType("text/plain");
		i.putExtra(Intent.EXTRA_SUBJECT, subj);