摘要: 分发事件的组件 Activity View ViewGroup 事件分发的核心方法 dispatchTouchEvent() onTouchEvent() onInterceptTouchEveent() onInterceptTouchEveent()只存在于ViewGroup中 如果某个组件的该 阅读全文
posted @ 2020-06-25 15:21 Kazix 阅读(161) 评论(0) 推荐(0)
摘要: OutOfMemory 1.资源释放问题 长时间保持某种资源,如corsor context io流的引用 资源得不到释放造成内存泄漏 2.对象内存过大 保存了多个消耗内存过大的对象 bitmap xml文件等 ,要及时释放 3.static关键字的使用问题 static用来修饰成员变量时,该成员变 阅读全文
posted @ 2020-06-20 16:38 Kazix 阅读(157) 评论(0) 推荐(0)
摘要: //mainactivity package com.example.my;import android.app.Activity;import android.content.ContentResolver;import android.content.Intent;import android. 阅读全文
posted @ 2020-06-20 13:53 Kazix 阅读(177) 评论(0) 推荐(0)
摘要: 获取bitmap的两种方式//第一种方式:从资源文件中得到图片Bitmap rawBitmap = BitmapFactory.decodeResource(getResources(),R.drawable.haha); //第二种方式:从SD卡中得到图片(方法1)String SDCarePat 阅读全文
posted @ 2020-06-20 11:56 Kazix 阅读(176) 评论(0) 推荐(0)
摘要: 相同:Activity 和 Application 都是 Context 的子类。 不同:维护的生命周期不同。 Context 维护的是当前的 Activity 的生命周期, Application 维护的是整个项目的生命周期。 使用 context 的时候,小心内存泄露,防止内存泄露 1. 不要让 阅读全文
posted @ 2020-06-19 14:42 Kazix 阅读(217) 评论(0) 推荐(0)
摘要: 1.默认启动模式standard: 一般不在manifest中设置的时候默认模式是standard,该模式下acitvity会依次被压入task中 2.栈顶复用模式singleTop: 该模式与standard相同,不会引起任务栈的变更, 唯一区别:singletop的activity处于栈顶时,再 阅读全文
posted @ 2020-06-19 14:34 Kazix 阅读(104) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-01-30 18:26 Kazix 阅读(121) 评论(0) 推荐(0)