首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 其他相关 >

搬动开发中的Scheme跳转说明——Allowing OtherApps to Start Your Activity

2013-09-07 
移动开发中的Scheme跳转说明——Allowing OtherApps to Start Your ActivityAllowing OtherApps to Start Yo

移动开发中的Scheme跳转说明——Allowing OtherApps to Start Your Activity

Allowing OtherApps to Start Your Activity

 

为了开发更多人使用的App,我们总希望我们的App能够提供一种接口被其他App调用。如我们常见的 大众点评 与  豆瓣。他们这种资源丰富的App能给我们提供很多丰富的资源。

例如豆瓣的scheme:

                 

 String id = "3102397";                    try                    {                        Uri url = Uri.parse("dianping://shopinfo?id=" + id);                        Intent intent = new Intent(Intent.ACTION_VIEW, url);                        mContext.startActivity(intent);                    }                    catch (Exception e)                    {                        // 没有安装应用,默认打开HTML5站                        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://m.dianping.com/shop/" + id));                        mContext.startActivity(intent);                    }


 

 

附件中上传了一个自己写的sheme的demo如果不清楚的可以看看


demo

热点排行