Android LruCache : how to put and get user's data
来源:互联网 发布:淘宝里的地址怎么修改 编辑:程序博客网 时间:2024/05/17 00:51
package zhangphil.cache;import android.graphics.Bitmap;import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import android.util.Log;import android.util.LruCache;public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); int CACHE_SIZE = 8 * 1024 * 1024; LruCache<String, Bitmap> mLruCache = new LruCache(CACHE_SIZE); int count = 5; String key; Bitmap bmp; for (int i = 0; i < count; i++) { key = String.valueOf(i); bmp = Bitmap.createBitmap(i + 1, i + 2, Bitmap.Config.ARGB_8888); mLruCache.put(key, bmp); } for (int i = 0; i < count; i++) { key = String.valueOf(i); bmp = mLruCache.get(key); Log.d("key:" + key, "value:" + bmp.getWidth() + "," + bmp.getHeight()); } }}
阅读全文
0 0
- Android LruCache : how to put and get user's data
- Android: How to get a custom View's height and width? [duplicate]
- How to get user information say: passwd
- A Programmer's Guide to Data Mining 2:Get started with recommendation system(User based filtering)
- Java tip: How to get CPU, system, and user time for benchmarking
- Android SDK How to Install and Get Started
- User Experience Coding How-To's
- How To Get Properties Data in Spring
- How to Get Started in Data Science
- How to reset user options and registr
- How to Enable User and Group Quotas
- How to get the Diagnostic data and debug file of Sales Order pick release
- How To determine DDIC Check Table, Domain and Get Table Field Text Data For Value?
- How to get new record's id
- How to Get Table’s Generated Ids
- Duwamish' Framewokes and data how to run !!!~~~
- CMFCPropertyGridCtrl: How to Validate and Update Data?
- how to config and use apt-get
- 模式的秘密---单例模式
- DP:about string
- AIDE MD主题配置
- 中国最好大学网爬取大学排名信息
- Oracle 删除表中记录 如何释放表及表空间大小
- Android LruCache : how to put and get user's data
- 学习Docker(2017-10-2)
- 《加密与解密》第三篇非明码比较分析,个人实战
- 【NOIP2016】换教室
- LinuxStudyNote(43)-图解Linux系统分区
- 刺杀
- some tips about python
- HDU 5521 Meeting
- 【Luogu3919】可持久化数组