android 基础

传说中的Activity周期:

android 基础_第1张图片
Activity生命周期

activity android:launchMode:

android 基础_第2张图片
LaunchMode

standard: 


android 基础_第3张图片

singleTop:


android 基础_第4张图片


android 基础_第5张图片

singleTask:

android 基础_第6张图片

singleInstance:


android 基础_第7张图片


View绘制流程:


android 基础_第8张图片

Touch事件机制:


android 基础_第9张图片

android:动画Animation,放大缩小,位置移动,加帧==

A Handler allows you to send and processMessageand Runnable objects associated with a thread'sMessageQueue. Each Handler instance is associated with a single thread and that thread's message queue. When you create a new Handler, it is bound to the thread / message queue of the thread that is creating it -- from that point on, it will deliver messages and runnables to that message queue and execute them as they come out of the message queue.


Looper.prepare();

//循环代码

Looper.loop();

Looper循环,自定义Handler用的


Handler+AsyncTask区别:AsyncTaskandHandlerare written in Java (internally they use aThread), so everything you can do withHandlerorAsyncTask, you can achieve using aThreadtoo.

If you are doing something isolated related to UI, for example downloading data to present in a list, go ahead and useAsyncTask.

If you are doing multiple repeated tasks, for example downloading multiple images which are to be displayed inImageViews(like downloading thumbnails) upon download, use a task queue withHandler.


加一点比较low的

在extend下,abstract是必须要继承的,protect和public可以用@override覆写,private完全由本class私有,protect本包私有,public没有私有。两个protect继承会先执行父类方法再执行本类方法

你可能感兴趣的:(android 基础)