首先在AndroidManifast.xml要被指定Scheme的Activity下设置如下参数

[html]  view plain  copy
  1. <intent-filter>  
  2.                 <category android:name="android.intent.category.DEFAULT">category>  
  3.                 <action android:name="android.intent.action.VIEW">action>  
  4.                 <data android:scheme="sh">data>  
  5.             intent-filter>  

这样即指定了接收Uri的Scheme为sh 且 Action为View的Intent。


利用如下Intent调用Activity

[java]  view plain  copy
  1. startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("sh://123123123")));  

在接收的Activity中使用如下代码获得数据

[java]  view plain  copy
  1. this.getIntent().getScheme();//获得Scheme名称  
  2. this.getIntent().getDataString();//获得Uri全部路径  

更多相关文章

  1. Android(安卓)Wifi 启动过程分析
  2. Android(安卓)+ Axis2
  3. Android(安卓)8.1.0 SystemUI 修改之 - 系统锁屏状态下点击用户
  4. [ZZ][Android]使用bindService启动服务
  5. OpenCV Android(安卓)通过 jni调用 使用opencv (Android(安卓)St
  6. Android(安卓)N调用系统安装APK方法报错原因整理及解决方案
  7. Linux/Android(安卓)NDK wchar_t 陷阱
  8. Win10下编译Android(安卓)Ogre3d 1.12.6
  9. Android(安卓)GridView选择样式

随机推荐

  1. android 无线连接eclipse
  2. Android工程打包
  3. Android(安卓)通过adb shell am broadcas
  4. Android 百度地图笔记
  5. [Android Studio导入第三方类库方法] Err
  6. Android(安卓)Studio 中build.gradle文件
  7. Android Studio开发(二)使用RecyclerView实
  8. Android 静默更新apk
  9. android 让5556和5554发发sms
  10. (一百八十九)Android Jetpack 学习(三)—— A