码迷,mamicode.com
首页 >  
搜索关键字:getresources    ( 268个结果
Android开发:notification通知以及通知不显示的问题
一.notification pushMessageButton = (Button)findViewById(R.id.pushMessage); final Bitmap largeIcon = ((BitmapDrawable) getResources().getDrawable(R.drawable.stefan)).getBitmap(); ...
分类:移动开发   时间:2016-04-29 16:18:25    阅读次数:354
28 android资源文件
使用:context.getResources().getString、getColor。。。 ...
分类:移动开发   时间:2016-04-27 22:30:47    阅读次数:230
8 屏幕适配
主流屏幕 1280*720 后期测试480*800 , 1920*1080 如果后期测试出现问题 图片适配: 不常用 布局适配: 不常用 尺寸适配: dp=px/设备密度 设备密度=getResources().getDisplayMetrics.density; 320*240(0.75) 480 ...
分类:其他好文   时间:2016-04-11 18:34:12    阅读次数:99
从加载图片OOM说起
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.big); Bitmap bitmap2 = BitmapFactory.decodeResource(getResources(), R.drawable.big); Bitmap bitmap3 = BitmapFact...
分类:其他好文   时间:2016-04-10 15:03:04    阅读次数:252
文件_ _android从资源文件中读取文件流并显示的方法
1 android从资源文件中读取文件流并显示的方法。 在android中,假如有的文本文件,比如TXT放在raw下,要直接读取出来,放到屏幕中显示,可以这样: private void doRaw(){ InputStream is = this.getResources().openRawRes ...
分类:移动开发   时间:2016-04-08 00:52:32    阅读次数:203
图片_ _ Bitmap_Drawable_Image?
1 b、读取res/drawable目录下的png或者bmp Resources r = this.getContext().getResources(); //以数据流的方式读取资源 Inputstream is = r.openRawResource(R.drawable.mm_image); ...
分类:其他好文   时间:2016-04-08 00:44:33    阅读次数:161
dp px 像素密度 分辨率
像素单位转换dp-px直接转换: int dp= (int) (px / context.getResources().getDisplayMetrics().density + 0.5f); int px= (int) (dp * context.getResources().getDisplay...
分类:其他好文   时间:2016-03-13 00:45:53    阅读次数:193
android eclipse 下制作像素鸟
从资源文件加载bitmap至内存 birdBmp=BitmapFactory.decodeResource(this.getContext().getResources(), R.drawable.bird); 从Bitmap创建Bitmap 及matrix变化应用 Bitmap birdBmp2=
分类:移动开发   时间:2016-03-07 23:55:03    阅读次数:238
Android 修改底部导航栏navigationbar的颜色
Android 修改底部导航栏navigationbar的颜色 getWindow().setNavigationBarColor(Color.BLUE); //写法一 getWindow().setNavigationBarColor(getResources().getColor(R.color
分类:移动开发   时间:2016-02-24 15:35:29    阅读次数:427
DrawableView
BitmapDrawablemBitmapDrawable; intx=1; inty=1; intw=0; inth=0; publicDrawableView(Contextcontext){ super(context); /*读取res->drawable文件下的图片*/ mBitmapDrawable=(BitmapDrawable)getResources().getDrawable(R.drawable.box); //w=mBitmapDrawable.getIntrin..
分类:其他好文   时间:2016-01-27 17:35:22    阅读次数:167
268条   上一页 1 ... 4 5 6 7 8 ... 27 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!