`
jguangyou
  • 浏览: 369766 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
ACTION_CHOOSER          用来显示一个供用户选择的应用列表,例如,你要打开一个视频,但是这个设备上有多个app都可以播放视频,这时候就会出现一个列表供用户选择,一般情况下是弹出式的。示例:   Intent intent = new Intent(); intent.setAction(Intent.ACTION_SEND); intent.setType("text/plain"); Intent intent2 = new Intent(); intent2.setAction(Intent.ACTION_CHOOSER); int ...

Intent和Intent Filters

 
Intent主要包含Componet name、Action、category、data、type、Extras以及flag。 Componet name        启动一个组件最直接的方式就是通过Componet name,也就是组件名称,它是一个ComponentName对象,指定组件可以通过一下几种方式: setComponent(ComponentName)   setClass(Context, Class) setClassName(Context, String) setClassName(String, String)     其实下面的 ...
/** * 从网络上异步加载单个图片 * * */ public class LoadOneImageFromNet extends Activity { Button button; ImageView iView; String imageUrl = "http://image.club.china.com/twhb/7137652/2012/11/17/1353147018580.jpg"; @Override protected void onCreate(Bundle savedInstanceState) { ...
       当在android应用中加载一张高分辨率的图片时,十分容易出现Out of memory(OOM),这是由于内存溢出造成的,每个应用所使用的堆内存大小一般是固定的,有的是16M,有的可能会大些。那为什么这么大内存加载一张图片会 ...
         在android中,使用this.getResources.getDrawable和BitmapFactory.decodeResource加载图片资源是有区别的,是用this.getResources.getDrawable方法加载图片资源时,无论对同一个资源加载多少次,堆内存的占用没有变化,也就是说再使用this.getResources.getDrawable加载同一个资源一次和加载100次,内存占用都是一样的(可能是共用一个堆内存,也就是你定义多个对象,但是这多个对象都指向同一个堆内存地址);但是使用BitmapFactory.decodeResource加载图片资源 ...
本文将由浅入深详细介绍Java内存分配的原理,以帮助新手更轻松的学习Java。这类文章网上有很多,但大多比较零碎。本文从认知过程角度出发,将带给读者一个系统的介绍。 进入正题前首先要知道的是Java程序运行在JVM(Java Virtual Machine,Java虚拟机)上,可以把JVM理解成Java程序和操作系统之间的桥梁,JVM实现了Java的平台无关性,由此可见JVM的重要性。所以在学习Java内存分配原理的时候一
A Drawable that manages a number of alternate Drawables, each assigned a maximum numerical value. Setting the level value of the drawable with setLevel() loads the drawable resource in the level list that has aandroid:maxLevel value greater than or equal to the value passed to the method. file loc ...
A drawable defined in XML that changes the size of another drawable based on its current level. file location: res/drawable/filename.xmlThe filename is used as the resource ID. compiled resource datatype: Resource pointer to a ScaleDrawable. resource reference: In Java: R.drawable.filenameIn XML: ...
A drawable defined in XML that clips another drawable based on this Drawable's current level. You can control how much the child drawable gets clipped in width and height based on the level, as well as a gravity to control where it is placed in its overall container. Most often used to implement th ...
This is a generic shape defined in XML. file location: res/drawable/filename.xmlThe filename is used as the resource ID. compiled resource datatype: Resource pointer to a GradientDrawable. resource reference: In Java: R.drawable.filenameIn XML: @[package:]drawable/filename syntax: <?xml ver ...
A LayerDrawable is a drawable object that manages an array of other drawables. Each drawable in the list is drawn in the order of the list—the last drawable in the list is drawn on top. Each drawable is represented by an <item> element inside a single <layer-list> element. file locati ...
    StateListDrawable用于组织多个Drawable对象。当使用StateListDrawable做为目标组件的背景、前景图片时,StateListDrawable对象显示的Drawable对象会随着目标组件的状态改变而改变。   file location:res/drawable/filename.xmlThe filename is used as the resource ID.compiled resource datatype:Resource pointer to a StateListDrawable.resource reference:In Java ...

android value 资源

This page defines more types of resources you can externalize, including: Bool XML resource that carries a boolean value. Color XML resource that carries a color value (a hexadecimal color). Dimension XML resource that carries a dimension value (with a unit of measure). ID XML resource that provi ...
一.应用资源的存储      存储目录 存放的资源 /res/animator/ 存放定义属性动画的xml文件 /res/anim/ 存放定义补间动画的xml文件 /res/color/ 存放定义颜色的xml文件 /res/drawable/ 存放各种图片(包括不同分辨率); 存放各种Drawable对象的xml文件: BitmapDrawable NinePatchDrawable StateListDrawable ShapeDrawable AnimationDrawable Drawable的其他各种子类的对象 ...
android:layout_width 指定组件布局宽度 android:layout_height 指定组件布局高度 android:alpha 设置组件透明度 android:background 设置组件背景颜色 android:clickable  设置组件是否可以激发单击事件 android:contentDescription  设置组 ...
Global site tag (gtag.js) - Google Analytics