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应用程序开发, ...
随机推荐
- Spring之我见
Spring 是什么(1) •Spring 是一个开源框架. •Spring 为简化企业级应用开发而生. 使用 Spring 可以使简单的 JavaBean 实现以前只有 EJB 才能实现的功能. • ...
- 05---Net基础加强
接口 public class Program { static void Main(string[] args) { IFlyable sp = new SupperMan(); sp.Fly(); ...
- sql ROUND() 函数三个参数的含义
ROUND的格式:ROUND(p1,p2,p3),其作用是取四舍四入值P1:要被四舍五入的数字P2:保留的小数位数P3:如果为0或不输入,则表示进P1进入四舍五入,如ROUND(123.86,1) = ...
- Java中的并发线程操作(只贴代码,内有注释)
package com.thread1; public class LiffOff implements Runnable{ protected int countDown = 10; private ...
- OpenStack collectd的从零安装客户端
1.查看是否需要增加yum 源 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [root@node-12 ~]# yum search collectd Loaded plugin ...
- http-使用get和post方式提交数据
注意点: 1.Get和post这两种提交方式有何不同? 很明显post方式提交多了content-length和content-type这两项,所以post提交是要为这两项设置setRequestPr ...
- PHP Deprecated: Comments starting with '#' are deprecated in *.ini 警告解决办法
新装的ubuntu 10.04系统,使用新立得装的PHP,但是每次我在命令行下执行php脚本时都会出如下的警告信息: PHP Deprecated: Comments starting with ' ...
- Mac OX 隐藏文件夹,文件,应用,磁盘的2种方法 hide finder folder, file, application, volume in 2 ways
经常需要主目录下隐藏一些文件夹之类的, 第一想到的当然就是:在要隐藏的文件夹前面加『.』(leading dot),这个用法当然可以的了 用习惯了Linux/GNU系统的,基本习惯使用这种办法 但是, ...
- SQL Server 复制 订阅与发布
SQL Server 复制 订阅与发布 通过SQL Server 2008数据库复制实现数据库同步备份 SqlServer2008 数据库同步的两种方式(Sql JOB) SqlServer2008 ...
- struts2结果类型
struts2结果类型: 结果类型 描述 前request域属性是否丢失 1 dispatcher 用于与jsp整合的结果类型.默认结果类型. 2 chain Action链式处理结果类型.前一个Ac ...