摘要:
1.在Androidmanifest.xml添加权限 <uses-permission android:name="android.permission.SYSTEM_OVERLAY_WINDOW" /> 2.创建悬浮窗 val daeMon = LayoutInflater.from(this). 阅读全文
摘要:
//自行替换自己的recyclerView val recyclerView = RecyclerView(this) val linearLayoutManager = LinearLayoutManager(this) recyclerView.layoutManager = linearLay 阅读全文
摘要:
首先在AndroidManifestxml文件创建一个Fileprovider(适配7.0以上的系统) Google参考:https://developer.android.google.cn/training/secure-file-sharing/setup-sharing <provider 阅读全文
摘要:
系统内存不足时,直接在内核层查杀(回收)进程,并不会考虑回收哪个Activity; 进程内存不足时,如果此进程 Activity Task数 >= 3 且 使用内存超过3/4,会对 不可见 Task进行回收,每次回收 1个 Task,回收时机为每次gc; 阅读全文
摘要:
第一种:class MyListView : ListView { constructor(context: Context?) : super(context) constructor(context: Context?, attrs: AttributeSet?) : super(context 阅读全文
该文被密码保护。 阅读全文
摘要:
面向对象:/** * 类与对象 *///创建一个类open class Person { var name = "" var age = 0 fun eat() { //第一种用变量的方法 print(name + "is eating." + "He is" + age + "years old" 阅读全文
摘要:
Kotlin的基础: Int,Short,Long,Float,Double,Boolen,Char,Byte,和Java对比所有首字母变大写,而且Kotlin只有引用类型,没有像Java有引用类型和基本数据类型 函数(方法):fun 函数名() /** * 变量 */ //可变变量 var h = 阅读全文
摘要:
原理: 首先获取根布局的Fragment 利用canvas和paint绘制一个透明背景 使用CLEAR作为PorterDuffXfermode绘制需要高亮的地方 然后在Fragment里addview自己需要的图片,例如箭头,文字说明等 代码:这是蒙版代码,里面包括需要高亮的View class M 阅读全文