android应用程序的三大组件——Activities、Services、Broadcast Receiver,通过消息触发,这个消息就是Intent,中文又翻译为"意图"(我感觉读着不顺畅,还是读英文)。我们可以通过Intent去启动三大组件,并且通过Intent携带数据到其他组件中。本文来看一下怎么使用Intent启动组件,以及Intent的过滤规则。
Intent对象
首先来看...
分类:
其他好文 时间:
2014-06-18 12:29:10
阅读次数:
271
我们常常在开发的时候,通过获取系统已启动的服务来判断该服务器是否还需要再启动。
而本文将介绍android设备中已启动的服务,并判断某一服务是启动
1.根据ACTIVITY_SERVICE获取系统服务
activityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
2.获取系统中正在运行的服务
runningList = activityManager.getRunningServices(30);//代表我们希望返回的服...
分类:
移动开发 时间:
2014-06-18 12:01:50
阅读次数:
247
自定义Dialog1.先上个效果图:虽然效果丑了点,但主要学习修改已有的控件,例如修改Dialog控件2.一些基本的只是进行了解Dialog:theme是Dialog的样式,常用样式为: 3.这里在对window,view,activity的关系就个简要的说明(1)View:最基本的UI组件,...
分类:
移动开发 时间:
2014-06-18 08:21:04
阅读次数:
375
package com.qianhua.ui;
002
003
import android.app.Activity;
004
import android.content.Intent;
005
import and...
分类:
其他好文 时间:
2014-06-17 23:02:36
阅读次数:
350
Structural Things
An
active class is a class whose objects own one or
more processes or threads and therefore can initiate control activity. An active class is just like a class except that it...
分类:
其他好文 时间:
2014-06-17 22:44:27
阅读次数:
310
上一篇文章介绍了ActionBar的使用,这里介绍ActionBar的另一种使用方法,达到的效果和以前的GroupActivity或TabHost是一样的,可作为导航来使用。
实现效果图:
源代码:
布局文件:activity_main:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/an...
分类:
移动开发 时间:
2014-06-17 22:22:13
阅读次数:
370
从前文《 源码解析:dialog, popupwindow, 和activity 的第一个view是怎么来的?》中知道了activity第一个view或者说根view或者说mDecorView 其实就是一个FrameLayout,以及是在系统handleResume的时候加入到系统windowManager中的,并由framework中的ViewRootImpl
接管,通过ViewRootIm...
分类:
其他好文 时间:
2014-06-17 22:07:59
阅读次数:
277
以前写过一篇ViewPager:内容content+指示点的Demo;
这篇文章继续介绍ViewPager:内容content+标题title的Demo。
实现效果图:
源代码:
布局文件:activity_main:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
...
分类:
移动开发 时间:
2014-06-17 21:46:09
阅读次数:
315
//获取当前的Activity名称package.classname privateStringgetTopActivity(Activitycontext){ ActivityManageram=(ActivityManager)getSystemService(Context.ACTIVITY_SERVICE); List<RunningTaskInfo>runningTasks=am.getRunningTasks(1); RunningTaskInforti=runn..
分类:
其他好文 时间:
2014-06-17 17:19:50
阅读次数:
245
转自:http://www.cnblogs.com/pswzone/archive/2012/03/10/2389275.htmlpackagecom.wps.android;importjava.util.ArrayList;importandroid.app.Activity;importand...
分类:
移动开发 时间:
2014-06-17 15:19:52
阅读次数:
254