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应用程序开发, ...
随机推荐
- ppaer 67 : matlab 函数errorbar
MATLAB ERRORBAR 这个函数的意思是:ERRORBAR(X,Y,L,U),X是自变量,Y是因变量,L是Y的变动下限,U是Y的变动上限 errorbar(X,Y,E) X是自变量,Y是因变 ...
- PAT乙级 1031. 查验身份证(15) 标志要清零!!!!!!!!!
1031. 查验身份证(15) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue 一个合法的身份证号码由17位地区. ...
- zw版【转发·台湾nvp系列Delphi例程】CheckDifference1
zw版[转发·台湾nvp系列Delphi例程]CheckDifference1 procedure TForm1.Button1Click(Sender: TObject);var img, img1 ...
- Debian下配置网络的方法
1.网络配置 配置网卡修改 /etc/network/interfaces 添加如下 # #号后面是备注,不要添加哦! auto eth0 #开机自动激活 iface eth0 inte static ...
- win7 64位系统下 PL/SQL无法连接的问题
第一步:下载oracle客户端 由于 PLSQL Developer 没有64位版本,所以在64位系统上运行该程链接64位Oracle时就会报错,笔者为这个问题纠结了好几天,后来通过请教Google ...
- Sqlserver Sql Agent Job 只能同时有一个实例运行
Sqlserver Sql Agent中的Job默认情况下只能有一个实例在运行,也就是说假如你的Sql Agent里面有一个正在运行的Job叫"Test Job",如果你现在再去启 ...
- android 百度地图定位开发1
首先注册成为百度开发者 然后进入百度开发者中心 点击LBS 跳到下一个页面 点击Android 开发 里面的基础地图 进入 点击获取密钥 进入 点击创建应用 进入 应用名称自己填 应用类 ...
- YUI3 CSS
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/stri ...
- mybatis 复习笔记03
参考:http://www.mybatis.org/mybatis-3/zh/configuration.html 入门 1. 从 XML 中构建 SqlSessionFactory 每个基于 MyB ...
- java简单的数据库查询(SQLServer数据库)
1.数据库链接类 import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; pu ...