Code example for URI

Methods: getPath, getQuery

0
 
	private void processMarket (String url) {
		String MarketUrl = null;
 
		try { 
			URI oldUri = new URI(url);
			String path = oldUri.getPath();
			String query = oldUri.getQuery();
			MarketUrl = "market:/" + path + "?" + query;
		} catch (URISyntaxException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} 
 
		if (MarketUrl != null) {
			Intent intent = new Intent();
			intent.setAction(Intent.ACTION_VIEW);
			intent.setData(android.net.Uri.parse(MarketUrl));
			startActivity(intent);
		}