随笔分类 - android
摘要:一。onConfigurationChanged 与android:configChangesLists configuration changes that the activity will handle itself. When a configuration change occurs at...
阅读全文
摘要:1.正常情况 正常启动的过程中,他们被调用的顺序是 onCreate -> onStart -> onResume, 在被干掉的时候顺序是onPause -> onStop -> onDestroy ,这样就是一个完整的生命周期。程序正运行着呢来电话了,新出的一个全屏的Activity,那么:...
阅读全文
摘要:apk程序是运行在虚拟机上的,对应的是Android独特的权限机制,只有体现到文件系统上时才使用linux的权限设置。(1)Android中的apk必须签名(2)基于UserID的进程级别的安全机制(3)默认apk生成的数据对外是不可见的(4)AndroidManifest.xml中的显式权限声明
阅读全文
摘要:一。要点If in the course of processing the event, the view's bounds may need to be changed, the view will callrequestLayout().Similarly, if in the course ...
阅读全文
摘要:Service 是android的一种机制,如果是Local Service,那么对应的 Service 是运行在主进程的 main 线程上的。如果是Remote Service,那么对应的 Service 则是运行在独立进程的 main 线程上。因此请不要把 Service 理解成线程,它跟线程半...
阅读全文
摘要:1.局部坐标系(Local Coordinate) 所谓本地坐标系,就是坐标系以物体的中心为坐标原点,物体旋转、平移等操作都是围绕局部坐标系进行的。这时当物体模型进行旋转、平移等操作时,局部坐标系也执行相应的旋转、平移等操作。2.全局坐标系(World Coordinate) 所谓全局坐标系就是将所...
阅读全文
摘要:1、ProgressBar有两个进度,一个是android:progress,另一个是android:secondaryProgress。比如视频的缓存进度以及播放进度。在这里缓存的进度就可以是android:secondaryProgress,而播放进度就是android:progress。 2、...
阅读全文
摘要:一。重要方法1.translate2.scale3.rotate二。注意1.明确顺序canvas.rotate(45);canvas.drawRect(new Rect(50, 50, 100, 100), paint);如果顺序调换,则没有旋转的效果2.转换的时候,需要把转换的中心点移到shape...
阅读全文
摘要:一。介绍public abstract void invalidateDrawable (Drawable who)Called when the drawable needs to be redrawn. A view at this point should invalidate itself ...
阅读全文
摘要:在onDraw方法里,我们经常会看到调用save和restore方法,它们到底是干什么用的呢?int px = getMeasuredWidth();int py = getMeasuredWidth(); // Draw backgroundcanvas.drawRect(0, 0, px, py...
阅读全文
摘要:If you are supporting pre-3.0 with your application be sure you put this version of the custom theme invalues-v11or similar.
阅读全文
摘要:onFling will get executed when a user makes a "fling" motion, and said motion has a velocity with it to determine the type of fling it was. However,...
阅读全文
摘要:1.IPC解决方案 而非 序列化机制 Container for a message (data and object references) that can be sent through an IBinder. A Parcel can contain both flatteneddata ...
阅读全文
摘要:Contains methods to standard constants used in the UI for timeouts, sizes, and distances.一。几个常用的方法返回初始化滑动的最大速度值和最小速度值,以像素/秒为单位getScaledMinimumFlingVel...
阅读全文
摘要:TouchDelegate(Rect bounds, View delegateView)Parameters:bounds Bounds in local coordinates of the containing view that should be mapped to the delegat...
阅读全文
摘要:There is no real difference, except that theView.postis helpful when you don't have a direct access to the activity. public boolean post(Runnable a...
阅读全文
摘要:A MeasureSpec encapsulates the layout requirements passed from parent to child. Each MeasureSpec represents a requirementfor either the width or the h...
阅读全文
摘要:public voidoverridePendingTransition(int enterAnim, int exitAnim) Call immediately after one of the flavors ofstartActivity(Intent)orfinish()to speci...
阅读全文
摘要:当用户触摸屏幕的时候,会产生许多手势,例如down,up,scroll,filing等等,我们知道View类有个View.OnTouchListener接口,通过重写他的onTouch(Viewv,MotionEventevent)方法,我们可以处理一些touch事件,但是这个方法太过简单,如果...
阅读全文