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应用程序开发, ...
随机推荐
- UML: 部署图
说部署图之前,先看看某24小时便利店管理系统的网络拓扑结构图: 这个图描述了本系统的整体物理结构,从该图我们可以得到以下信息:1.该便利店集团有总部和多个门店,总部管理财务.仓库.采购等事宜.2.二级 ...
- Openssl生成根证书、服务器证书并签核证书
1.修改Openssl配置文件CA目录: cat /etc/pki/tls/openssl.cnf dir = /etc/pki/CA 2.生成根证书及私钥: #http://www.haiyun.m ...
- docker gitlab
Alternatively, you can manually launch the gitlab container and the supporting postgresql and redis ...
- Java实现文件的读写,复制
import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.FileInputStr ...
- thinphp讲解(三)——空操作、空控制器、跨控制器、命名空间
一.“空操作”本质意思:一个对象(控制器)调用本身不存在的操作方法 一般网站处于安全考虑不给用户提示任何错误信息 在tp里面控制器controller.class.php里有个_call()方法 所以 ...
- 【ruby】ruby基础知识
Install Ruby(安装) For windows you can download Ruby from http://rubyforge.org/frs/?group_id=167 for L ...
- 新发现了一个编辑器HBuilder,感觉蛮好的,关键是国产软件。
http://www.dcloud.io/
- spring支持的websocket
首发:个人博客 必须说明:这篇博文只用于自己记录,使用spring的websocket支持一定要看官方文档,权威又简明,不推荐看不专业又啰嗦的国产博文. 已尝试了两种方法,当然,不管哪种方法都要先添加 ...
- linux异步通信之epoll【转】
转自:http://www.cnblogs.com/snake-hand/archive/2012/08/13/2636229.html 1.简介 epoll是linux提供的一种异步的I/O通知方式 ...
- 安装新版xampp后apache无法启动提示:Apache Service detected with wrong path解决方案
我以前安装过xampp,因为学习thingPHP需要升级PHP5.0以上,所以我就卸掉了xampp,从新安装新版本的xampp其中PHP是最新版的,但是安装后启动xampp提示如下:Apache Se ...