Google TV devices have higher display resolution. If you provide low resolution or small images in your layouts, they will appear pixelated, fuzzy, or grainy. This is not a good experience for the user. Instead, use high resolution images. Remember, though, that downloading and storing high-resolution images may cause "out of memory" errors. To avoid these errors, follow these tips:
- Load images only when they're displayed on the screen. For example, are displaying multiple images in a
GridView
, ListView
or Gallery
, only load an image when its getView() is called.
- Call
recycle()
on Bitmaps that are no longer needed.
- Use WeakReferences for storing references to Bitmap objects in a in memory collection.
- If you fetch the images from the network, use AsyncTask to fetch them all at once or as needed. Never do network transactions on the main ("UI") thread. Instead, if possible, fetch all the images at once on a background thread, and store them on the sdcard.
- Scale down very large images to a more appropriate size as you download them; otherwise, downloading the image may cause an "out of memory" error. Here is sample code that does this scaling while downloading:
分享到:
相关推荐
A Globally Distributed System for Job, Data, and Information Handling for High-Energy Physics
Moisture Sensitivity/Desiccant Packaging/Handling of PSMCs
libuv is a multi-platform support library with a focus on asynchronous I/O. It was primarily developed for use by [Node.js][], but ... * High resolution clock * Threading and synchronization primitives
Tools for big matrix elaboration in OS Window 2000/NT... A useful Excel addin for handling large matrices. Help on-line. Freeware. Bigmatrix supports only the point as decimal separators 内含使用指南!!
sap Handling unit introduction
Windows Exception Handling
Large Scale Machine Learning with Python uncovers a new wave of machine learning algorithms that meet scalability demands together with a high predictive accuracy. Dive into scalable machine ...
gta Handling Editor 4 or hz
Spark is capable of handling large-scale batch and streaming data to figure out when to cache data in memory and processing them up to 100 times faster than Hadoop-based MapReduce.This means ...
pandas 0.19.2 (有API,带书签,英文) pandas: powerful Python data analysis toolkit Release 0.19.2 Wes McKinney & PyData Development Team Dec 24, 2016
NULL 博文链接:https://haoyp.iteye.com/blog/1211547
该文档是美团cat监控系统的服务器搭建,主要描述的是windows系统下,单机部署美团cat监控系统,客户端的使用请看下一个文件。
contains OCR class for handling OCR images.
Handling3DInteractionandUIControlsinAugmentedReality ARKit 3D AR swift demo
唤起框架如您所知,在 android 中下载大文件是一团糟,因此如果您想自己下载或者您更喜欢 android 在 DownloadManager 中的构建,则需要管理连接和部件,但它太慢了,并且使用默认的 apache 客户端进行网络操作,该...
// do error handling } // work with the received data } ) ; 数据结构 一天的代表: { "date" : string // date string with format 'YYYY-MM-DD' "items" : array , // array with menu descriptions ...
Let’s set up the scaffolding for the internal error-handling framework. Start by creating a new single view application project. In this new project, create a new class file that subclasses NSObject....
Abe M. Vehicle Handling Dynamics: Theory and Application[M]
api-ms-win-core-errorhandling-l1-1-0.dll
a high dv/dt characteristics. At the same time, the leakage inductance results in voltage spikes and ringing, consequently generating noise due to the high dv/dt as shown in Figure 1 and 2. Typically,...