摘要: 正确应对系统内存不足,OnLowMemory和OnTrimMemory回调 1. OnLowMemory OnLowMemory是Android提供的API,在系统内存不足,所有后台程序(优先级为background的进程,不是指后台运行的进程)都被杀死时,系统会调用OnLowMemory。 系统为 阅读全文
posted @ 2018-08-24 16:34 云中雀 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 我们都知道,在Android中,Service有两种启动方式: startService 以startService()启动服务,系统将通过传入的Intent在底层搜索相关符合Intent里面信息的service。如果服务没有启动则先运行onCreate,然后运行onStartCommand (可在 阅读全文
posted @ 2018-08-24 16:27 云中雀 阅读(1922) 评论(0) 推荐(0) 编辑