Intent实现跳转到网页,其他app的界面
2015-10-17 11:33
316 查看
private void jumpToUrl() { Intent intent = new Intent(); intent.setAction("android.intent.action.VIEW"); Uri content_url = Uri.parse("https://www.baidu.com/"); intent.setData(content_url); startActivity(intent); } private void jumpToMicroTest() { ComponentName componentName=new ComponentName("com.lany.screenshot","com.lany.screenshot.MainActivity"); Intent intent = new Intent(); intent.setComponent(componentName); intent.setAction(Intent.ACTION_VIEW); intent.putExtra("Version", getSimpleVersionInfo()); intent.putExtra("buildNumber", buildNumber); startActivity(intent); }
除了跳转,还可以附带数据,注意在跳转到其他app时,跳转到的app必须在跳转到的界面的manifest文件中定义exported=true,否则无法正常跳转。
相关文章推荐
- Android中数据的存储方式(二)—SQLite数据库
- Android消息处理
- android 28 SimpleAdapter
- 【Unity】UGUI怎么动态的添加按钮的OnClick点击事件
- Android——处理设备旋转Activity销毁时临时数据丢失的问题
- NSUserDefault 保存自定义对象
- 【Android】ListView内数据的动态追加
- 【Android】使用Gallery组件实现图片播放预览
- android布局
- 【Android】使用Gallery组件实现循环显示图像
- 根据日期计算星座
- 【Android】Android常见的错误及解决
- 使用registerActivityLifecycleCallbacks实现整个app所有activity生命周期的监听和处理
- iOS录音
- 【Android】使用Popwindow实现左侧弹出菜单层
- 【Android】图片切换组件ImageSwitcher的运用
- 根据日期计算年龄
- Android 基于ImageSwitcher实现的左右切换图片
- Android得到本地SHA1、MD5(百度地图及Google地图)
- unity之通知中心