by web_surf - 移动操作系统 - 2011-12-22 08:51:11 阅读(872) 回复(0)
Introduction This tutorial will show you how to create a sub-activity from a calling-activity, and process the results produced by the sub-activity, if you want to do so. Also, the various ways of launching a sub-activity are covered, along with the android activity history stack. A subclass of activity is also provided that makes it trivial to launch sub-Activities and respond to results fro...
activity 是我们 开发 android应用程序最重要的一个类。这个类的内容比较多,我理解多少 就写多少,希望你喜欢:) 这篇文章会涉及到以下几个内容 一 activity的生命周期 二 让activity变成一个窗口:activity属性设定 三 你后台的activity被系统回收怎么办:onSaveInstanceState 四 调用与被调用:我们的通信使者 - Intent 一 activity的生命周期 和其他手机平台的应用程序一样,android的应用程序的生命周期是被统一掌控 的,...
对 http://code.google.com/android/reference/android/app/activity.html 进行了翻译整理,以便对activity类有一个整体了解。 activity类处于android.app包中,继承体系如下: 1.java.lang.Object 2.android.content.Context 3.android.app.ApplicationContext 4.android.app.activity activity是单独的,用于处理用户操作。几乎所有的activity都要和用户打交道,所以activity类创建了一个窗口,开发人员可以通过 setContent...
android Touch事件 android中跟Touch事件有关的事件有三个: public boolean dispatchTouchEvent(MotionEvent ev):传递Touch事件至target view(可以是自己)。 public boolean onInterceptTouchEvent(MotionEvent ev):在ViewGroup中定义,用于拦截Touch事件的传递。 public boolean onTouchEvent(MotionEvent event): Touch事件处理函数。 先说下事件传递的两种方式: 隧道...
android事件触发机制
首先,这篇文章仅仅针对于由于触摸(Touch)而触发的事件。
android的事件:onClick, onScroll, onFling等等,都是由许多个Touch组成的。其中Touch的第一个状态肯定是ACTION_DOWN, 表示按下了屏幕。之后,touch将会有后续事件,可能是:
ACTION_MOVE //表示为移动手势
ACTION_UP //表示为离开屏幕
ACTION_CANCEL //表示取消手势,不会由用户产生,而是由程序产生的
一个Action_DOWN, n个ACTION_MOVE, ...
EventHub:
而事件的传入是从EventHub开始的,EventHub是事件的抽象结构,维护着系统设备的运行情况,设备类型包括Keyboard、
TouchScreen、TraceBall。它在系统启动的时候会通过open_device方法将系统提供的输入设备都增加到这个抽象结构中,并维护
一个所有输入设备的文件描述符,如果输入设备是键盘的话还会读取/system/usr/keylayout/目录下对应键盘设备的映射文件,另外
getEvent方法是对EventHub中的设备文件描述符使用poll操...
android输入事件流程
转载时请注明出处和作者联系方式
文章出处:
http://www.limodev.cn/blog
作者联系方式:李先静
EventHub对输入设备进行了封装。输入设备驱动程序对用户空间应用程序提供一些设备文件,这些设备文件放在/dev/input里面。
EventHub扫描/dev/input下所有设备文件,并打开它们。
bool EventHub::openPlatformInput(void)
{
...
mFDCount = 1;
mFDs = (pollfd *)calloc(1, sizeof(mFDs[0]));
...