android 入门 007(界面跳转)
一、隐式跳转(自定义界面)
界面层:
<Button
android:id="@+id/sencond_contact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="跳转至second1界面隐式"
android:onClick="click_jump_sencond_yinshi"
/>
java层
public void click_jump_sencond_yinshi(View v)
{
Intent intent=new Intent();
intent.setAction("cn.rfvip.yinshijiemian");//次名为清单中的 <intent-filter > <action android:name="cn.rfvip.yinshijiemian"/>
//跳转
startActivity(intent);
}
清单层(AndroidManifest.xml)
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="cn.rfvip.jumpActivity.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="cn.rfvip.jumpActivity.second">
<intent-filter >
<action android:name="cn.rfvip.yinshijiemian"/>
<category android:name="android.intent.category.DEFAULT"/></intent-filter> </activity>
</application>
二、显示跳转(自定义界面)
界面层:
<Button
android:id="@+id/sencond_contact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="跳转至second界面显示"
android:onClick="click_sencond_contact"
/>
java 层:
//显示跳转
public void click_sencond_contact(View v)
{
Intent intent=new Intent();
intent .setClass(this, cn.rfvip.jumpActivity.second.class);//此处可以省略包名
//intent.setClass(this, second.class);
//跳转
startActivity(intent); }
清单层(AndroidManifest.xml)(注意权限)
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="cn.rfvip.jumpActivity.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="cn.rfvip.jumpActivity.second">
</activity>
</application>
三、隐式跳转系统外部应用
界面层
<Button
android:id="@+id/main_callphone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="click_main_callphone"
android:text="隐式跳转系统拨号"
/>
<Button
java层
//隐式跳转打电话
public void click_main_callphone(View v)
{
Intent intent=new Intent();
intent.setAction(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:10000"));
//跳转
startActivity(intent);
}
清单层(AndroidManifest.xml)(注意权限)
android 入门 007(界面跳转)的更多相关文章
- Android之Activity界面跳转--生命周期方法调用顺序
这本是一个很基础的问题,很惭愧,很久没研究这一块了,已经忘得差不多了.前段时间面试,有面试官问过这个问题.虽然觉得没必要记,要用的时候写个Demo,打个Log就清楚了.但是今天顺手写了个Demo,也就 ...
- Android 手机卫士--设置界面&功能列表界面跳转逻辑处理
在<Android 手机卫士--md5加密过程>中已经实现了加密类,这里接着实现手机防盗功能 本文地址:http://www.cnblogs.com/wuyudong/p/5941959. ...
- Android activity界面跳转动画
实现activity界面跳转动画 1.在startActivity方法之后加入: overridePendingTransition(R.anim.pull_in_right, R.anim.pull ...
- Android开发之Intent跳转到系统应用中的拨号界面、联系人界面、短信界面
现在开发中的功能需要直接跳转到拨号.联系人.短信界面等等,查找了很多资料,自己整理了一下. 1.跳转到拨号界面,代码如下: 1)直接拨打 Intent intentPhone = new Intent ...
- Android基础-系统架构分析,环境搭建,下载Android Studio,AndroidDevTools,Git使用教程,Github入门,界面设计介绍
系统架构分析 Android体系结构 安卓结构有四大层,五个部分,Android分四层为: 应用层(Applications),应用框架层(Application Framework),系统运行层(L ...
- Android原生和H5交互;Android和H5混合开发;WebView点击H5界面跳转到Android原生界面。
当时业务的需求是这样的,H5有一个活动商品列表的界面,IOS和Android共用这一个界面,点击商品可以跳转到Android原生的商品详情界面并传递商品ID: 大概就是点击H5界面跳转到Androi ...
- Android——实现欢迎界面的自动跳转(转)
Android实现欢迎界面的自动跳转,就是打开某一个安卓手机应用,出现的欢迎界面停留几秒钟,自动进入应用程序的主界面.在网上看到很多种实现办法,但是感觉这种方法还是比较简单的. 在onCreate里设 ...
- 界面跳转+Android Studio Button事件的三种方式
今天学习界面跳转 java类总是不能新建成功 看了网上教程 (20条消息) 关于android studio无法创建类或者接口问题的解决方法_qq_39916160的博客-CSDN博客 可以新建了 但 ...
- iOS界面跳转的一些优化方案
原文地址: http://blog.startry.com/2016/02/14/Think-Of-UIViewController-Switch/ iOS界面跳转的一些优化方案 App应用程序开发, ...
随机推荐
- Excel 生成sql语句
CONCATENATE 拼接字符串 IF 不能跟 CONCATENATE 连用,所以可以通过建立新列去完成更高的需求 新建一列 cw=CONCATENATE("insert into biC ...
- Demo12SimpleAdapter
/Users/alamps/AndroidStudioProjects/Demo12SimpleAdapter/Demo12SimpleAdapter/src/main/res/layout/data ...
- 夺命雷公狗---DEDECMS----31dedecms数据库创建一张表完成curl操作
首先我们创建一张测试表,格式如下所示: 然后我们还是在plus目录下创建一个test3.php进行测试,首先写一个添加的: <?php header("Content-Type:tex ...
- PAT乙级 1004. 成绩排名 (20)
1004. 成绩排名 (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue 读入n名学生的姓名.学号.成绩,分 ...
- 【PyQuery】PyQuery总结
pyquery库是jQuery的Python实现,可以用于解析HTML网页内容, 官方文档地址是:http://packages.python.org/pyquery/. 二.使用方法 ? 1 fro ...
- MKCOL not allowed
通过TortoiseSvn操作GitHub的时候出现下图提示: 原因:尝试在根目录创建新的文件夹(文件),貌似是不被允许的行为 解决:只能在trunk 或者 branches下再新建文件夹(文件)
- RMB转换人民币大小金额
MXS&Vincene ─╄OvЁ &0000015 ─╄OvЁ MXS&Vincene MXS&Vincene ─╄OvЁ:今天很残酷,明天更残酷,后天很美好 ...
- android 学习随笔八(异常处理总结)
1.在android 中开发java.net.SocketException: socket failed: EACCES (Permission denied) 报错 第一反应就是缺少网络权限,然后 ...
- mybatis 复习笔记03
参考:http://www.mybatis.org/mybatis-3/zh/configuration.html 入门 1. 从 XML 中构建 SqlSessionFactory 每个基于 MyB ...
- 鸟哥的linux私房菜学习记录之认识系统服务(daemons)