博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
android Activity之间跳转。
阅读量:2194 次
发布时间:2019-05-02

本文共 320 字,大约阅读时间需要 1 分钟。

1、首先得有两个Activity,假设为Class A和Class B。

2、(这里假设从A跳到B),Class A 和B必须在Manifest.xml注册过

<activity android:name=".A" >    

        </activity> 

<activity android:name=".B" >    

        </activity> 

若A B中有一个为首Activity,则会被自动注册。类名前的“.”表示当前包

3、在A中使用Intent: Intent intent = new Intent();

             intent.setClass(A.this, B.class);

startActivity(intent);

这样既可完成从A到B的跳转。

转载地址:http://rysub.baihongyu.com/

你可能感兴趣的文章
(PAT 1061) Dating (字符串处理)
查看>>
(PAT 1118) Birds in Forest (并查集)
查看>>
数据结构 拓扑排序
查看>>
(PAT 1040) Longest Symmetric String (DP-最长回文子串)
查看>>
(PAT 1145) Hashing - Average Search Time (哈希表冲突处理)
查看>>
(1129) Recommendation System 排序
查看>>
PAT1090 Highest Price in Supply Chain 树DFS
查看>>
(PAT 1096) Consecutive Factors (质因子分解)
查看>>
(PAT 1019) General Palindromic Number (进制转换)
查看>>
(PAT 1073) Scientific Notation (字符串模拟题)
查看>>
(PAT 1080) Graduate Admission (排序)
查看>>
Play on Words UVA - 10129 (欧拉路径)
查看>>
mininet+floodlight搭建sdn环境并创建简答topo
查看>>
【linux】nohup和&的作用
查看>>
Set、WeakSet、Map以及WeakMap结构基本知识点
查看>>
【NLP学习笔记】(一)Gensim基本使用方法
查看>>
【NLP学习笔记】(二)gensim使用之Topics and Transformations
查看>>
【深度学习】LSTM的架构及公式
查看>>
【python】re模块常用方法
查看>>
剑指offer 19.二叉树的镜像
查看>>