通过web页面调起native App

首先在Mainifest文件里面对要启动的Activity添加一个过滤器。

  
            
                

                
            

            
                
                
                
                
            
        

activity接收数据

	private void handleWebCall(){
		Intent intent = getIntent();
		String scheme = intent.getScheme();
		Uri uri = intent.getData();
		System.out.println("scheme:"+scheme);
		if (uri != null) {
			String host = uri.getHost();
			String dataString = intent.getDataString();
			String id = uri.getQueryParameter("d");
			String path = uri.getPath();
			String path1 = uri.getEncodedPath();
			String queryString = uri.getQuery();
			System.out.println("host:"+host);
			System.out.println("dataString:"+dataString);
			System.out.println("id:"+id);
			System.out.println("path:"+path);
			System.out.println("path1:"+path1);
			System.out.println("queryString:"+queryString);
		}
	}

网页中调用示例  < a   href = "znn://aa.bb:80/test?p=12&d=1" > test a >   


你可能感兴趣的:(android,Android,通过网页打开自己的APP)