码迷,mamicode.com
首页 >  
搜索关键字:getresources    ( 268个结果
robotium之无name、ID仅有desc定位
robotium之无name、ID仅有desc定位场景如图:没有name和ID,群里问了,也没人搭理我,自己试验了下,发现这个法子可用,直接贴代码:Activityact=solo.getCurrentActivity();intidentifier=act.getResources().getIdentifier("Moreoptions","content-desc",act.getPacka
分类:其他好文   时间:2020-12-05 10:34:57    阅读次数:4
android 字符串拼接获取图片
ApplicationInfo appInfo = getApplicationInfo(); int resID = getResources().getIdentifier(substring, "mipmap", appInfo.packageName);// BitmapFactory.de ...
分类:移动开发   时间:2020-08-05 10:29:02    阅读次数:96
bitmap
获取bitmap的两种方式//第一种方式:从资源文件中得到图片Bitmap rawBitmap = BitmapFactory.decodeResource(getResources(),R.drawable.haha); //第二种方式:从SD卡中得到图片(方法1)String SDCarePat ...
分类:其他好文   时间:2020-06-20 14:20:49    阅读次数:49
textview设置部分文字颜色、点击事件
SpannableStringBuilder spannable = new SpannableStringBuilder(getResources().getString(R.string.home_dialog_reg_protocol));spannable.setSpan(new MyCli ...
分类:其他好文   时间:2020-01-12 09:44:49    阅读次数:112
横竖屏切换
我是参考这篇文章 :https://www.jianshu.com/p/dbc7e81aead2 主要是布局分横竖屏 然后再java代码 Configuration cf = this.getResources().getConfiguration(); int ori = cf.orientati ...
分类:其他好文   时间:2020-01-10 10:41:33    阅读次数:72
Android:用Intent传送图片
三种方法对应三种情况: 1.传送本地res中的图片 如果是本地res中的资源文件可以用intent.putExtra(""id"", R.id.xxx);传递一个对应的id过去。在新activity中通过id取出图片。getResources().getDrawable(R.id.xxx); 传送图 ...
分类:移动开发   时间:2019-12-29 16:46:19    阅读次数:247
Android:系统添加自定义鼠标样式并通过按键切换
一、APP通过View修改鼠标样式 app view上修改鼠标样式比较简单,通过 hover event 获取鼠标坐标并使用如下方法修改为自定义图片: getWindow().getDecorView().setPointerIcon(PointerIcon.load(getResources(), ...
分类:移动开发   时间:2019-11-28 01:09:27    阅读次数:390
Android中getResources().getConfiguration()方法的作用
Android中Configuration类专门用于描述手机设备上的配置信息,这些配置信息既包括用户特定的配置项,也包括系统的动态设备配置。 Configuration对象获得: Configuration对象提供的基本属性可以获取系统的配置信息: 如果程序需要监听系统设置的更改,这里就需要重写Ac ...
分类:移动开发   时间:2019-10-25 18:39:50    阅读次数:245
java常用关键词关键字,方法源码解析
transient volatile native final Integer String Class &&Object newInstance Class.forName,ClassLoader.loadClass ClassLoader .getResources(), ClassLoader ...
分类:编程语言   时间:2019-09-13 22:29:01    阅读次数:154
像素 转换 px dp
public static int dip2px(Context context, float dpValue){ final float scale = context.getResources().getDisplayMetrics().density; return (int)(dpValue ...
分类:其他好文   时间:2019-01-13 17:04:27    阅读次数:199
268条   1 2 3 4 ... 27 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!