通过Intent启动Activity

本文地址: http://blog.csdn.net/caroline_wendy

为了动态关联Activity界面,使用Intent启动。能够灵活绑定
Intent静态类中。定义Intent的内容:
public static final String ACTION_HOME = "me.cxxxyx.CxxxyxIntent.ACTION_HOME";

然后通过Intent启动startActivity(intent)其它的Activity:
Intent intent = new Intent();
intent.setAction(CxxxyxIntent.ACTION_HOME);
startActivity(intent);

须要在AndroidManifest中注冊对应的过滤器:
        <activity
android:name="me.cxxxyx.hwdxxxxx.HomePageActivity"
android:screenOrientation="portrait"
android:launchMode="singleTask"
android:theme="@style/CxxxyxHW.Activity"> <intent-filter>
<action android:name="me.cxxxyx.CxxxyxIntent.ACTION_HOME"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <data
android:scheme="cxxxyx"
android:host="launch"
android:pathPattern="/home"/> </intent-filter>
</activity>

即能够跳转界面(Activity)

Android - 通过Intent启动Activity的更多相关文章

  1. Android(java)学习笔记73:Intent启动Activity

    1. Intent启动Activity案例 (1)首先是main.xml和other.xml文件如下: main.xml文件: <?xml version="1.0" enc ...

  2. Android 跨进程启动Activity黑屏(白屏)的三种解决方案

    原文链接:http://www.cnblogs.com/feidu/p/8057012.html 当Android跨进程启动Activity时,过程界面很黑屏(白屏)短暂时间(几百毫秒?).当然从桌面 ...

  3. 通过intent启动Activity

    android应用程序内部通过Intent来实现Activity间的跳转.也知道通过Intent调用系统程序.但若想在应用程序A内开启应用程序B(前提是A.B均已安装),该如何去实现? 记录下实现过程 ...

  4. Android隐式启动Activity可能存在的坑

    转载本专栏文章,请注明出处,尊重原创 .文章博客地址:道龙的博客 本篇文章已授权微信公众号 guolin_blog (郭霖)独家发布 本篇文章,对隐式启动Activity再做分析. 有些人可能会说了, ...

  5. phonegap android插件,启动activity并返回值

    Your execute menthod is not quite right. When you do: return new PluginResult(PluginResult.Status.OK ...

  6. Android之Intent和Activity

    Intent能够说是Android的灵魂,程序跳转和传递数据的时候基本上就是靠Intent了.Intent在Android应用中是相当重要的,理解Intent相应用编程非常有帮助.在Android的官 ...

  7. Android笔记---Intent实现Activity跳转

    学了之前的Android控件以及布局,我们就能够做一些UI的设计了,这里我结合之前的知识.以一个小的登录项目来解说下Activity之间跳转. 先看下效果图: 1.登录界面: 2.点击登录按钮跳转到另 ...

  8. intent 启动activity、service的方法

    1.通过intent启动service. 通过传递一个Intent对象至Context.startService()将启动一个服务(或给予正在运行的服务以一个新的指令).Android调用服务的onS ...

  9. 从零开始学android开发-用Intent启动Activity的方法

    启动另外一个Activity,可以有的方法有用setClass()和Component Name 1. 先说在setClass启动一个Activity的方法吧: Intent intent = new ...

随机推荐

  1. shell telnet 路由器

    #!/usr/bin/expect -f spawn telnet 172.16.1.80 expect "login" { send "admin\n" ex ...

  2. SuperSocket应用之FTP源码解析

    一 简述 命令行协议是一种使用比较多的协议,其优点在于使用简单易于扩展性,同时也利于解析和使用.FTP,POP,SMTP等均采用命令行协议,其中FTP在早起互联网时期成为网络资源共享的主要方式,可见F ...

  3. How to find configuration file MySQL uses?(转)

    http://www.dbasquare.com/2012/04/01/how-to-find-mysql-configuration-file/ A customer called me today ...

  4. 最完整的历史记录hadoop

    课程主要涉及Hadoop Sqoop.Flume.Avro重要子项目的技术实战 课程针对人群 1.本课程适合于有一定java基础知识.对数据库和sql语句有一定了解,熟练使用linux系统的技术人员, ...

  5. Swift - 歌曲播放样例(附带播放时间和播放进度)

    使用MPMoviePlayerController我们可以是进行音乐播放,下面是一个播放器样例.同时,播放时还可以显示播放时间和播放进度. 1 2 3 4 5 6 7 8 9 10 11 12 13 ...

  6. 积累的VC编程小技巧之视图

    1.如何得到视图指针 [问题提出]    现在你有一个多线程的Demo,你想在多线程里处理视图指针里的函数,我们给这个函数起个名字:Put();该如何实现呢?   //有两种方法可以实现你的要求:   ...

  7. byte为什么要与上0xff(转)

    无意间翻看之间的代码,发现了一段难以理解的代码. byte[] bs = digest.digest(origin.getBytes(Charset.forName(charsetName))) ; ...

  8. Disable root 账号登陆

    1. 改动文件: /etc/ssh/sshd_config #PermitRootLogin yes 改动为: PermitRootLogin no 2. 重新启动ssh进程 /etc/init.d/ ...

  9. Static关键字的作用及使用

    1.使用static声明属性 如果希望一个属性被所有对象共同拥有,可以将其声明为static类型. 声明为static类型的属性或方法,此属性或方法也被称为类方法,可以由类名直接调用. class P ...

  10. skynet源代码学习 - 从全局队列中弹出/压入一个消息队列过程

    学习云风的skynet源代码,简单记录下. void skynet_globalmq_push(struct message_queue * queue) { struct global_queue ...