intent的简单用法
来源:互联网 发布:ubuntu的root权限 编辑:程序博客网 时间:2024/05/16 11:28
intent的简单用法
一,跳转
显式:直接通过 intent
Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
startActivity(intent);
隐式:通过代码和清单文件来完成操作
<activity android:name=".SecondActivity" >
<intent-filter>
<action android:name="com.example.activitytest.ACTION_START" />
<category android:name="com.example.activitytest.MY_CATEGORY"/>
</intent-filter>
</activity>
Intent intent = new Intent("com.example.activitytest.ACTION_START");
intent.addCategory("com.example.activitytest.MY_CATEGORY");
startActivity(intent);
二,打开webview
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("http://www.baidu.com"));
startActivity(intent);
一,跳转
显式:直接通过 intent
Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
startActivity(intent);
隐式:通过代码和清单文件来完成操作
<activity android:name=".SecondActivity" >
<intent-filter>
<action android:name="com.example.activitytest.ACTION_START" />
<category android:name="com.example.activitytest.MY_CATEGORY"/>
</intent-filter>
</activity>
Intent intent = new Intent("com.example.activitytest.ACTION_START");
intent.addCategory("com.example.activitytest.MY_CATEGORY");
startActivity(intent);
二,打开webview
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("http://www.baidu.com"));
startActivity(intent);
0 0
- intent的简单用法
- Intent和Activity的简单用法
- Intent用法简单总结
- Intent的常见用法
- Intent的常见用法
- Intent的用法总结
- Activitu Intent的用法
- Intent的若干用法
- Intent 的用法
- Intent 的用法
- Intent的实例用法
- Intent的用法
- Intent的用法
- Intent的用法
- Intent的常见用法
- Intent的用法
- Intent的常见用法
- Intent的用法
- 飞机大战游戏及源码地址
- 高并发系统之限流特技 --一路狂奔
- 基于Bmob平台数据管理常用方法整理
- 将Jar加入到Maven仓库
- String,StringBuffer,StringBuilder区别
- intent的简单用法
- Android生命周期详解
- oc内存原理
- Java的内存泄漏
- java常用工具类整理
- JAVA是解释型语言还是编译型语言
- 数据库事务介绍
- android界面视觉设计规范
- python错误:IndentationError:expected an indented block