2015年1月21日

摘要: google官方建议在textView和imageView挨着的时候,建议使用drawable来显示图片第一个方法:setCompoundDrawablesWithIntrinsicBounds(Drawableleft,Drawabletop,Drawableright,Drawablebotto... 阅读全文
posted @ 2015-01-21 16:28 行殇 阅读(1504) 评论(0) 推荐(1) 编辑

2015年1月20日

摘要: 这是一个listpopwindow的布局,如果listview在relativeLayout之后写的那么listview就会把relativeLayout给覆盖掉,这证明布局的加载是按照布局文件写的先后顺序来加载的,也就是说先绘制listView,然后在绘制relativeLayout.解决办法: ... 阅读全文
posted @ 2015-01-20 19:00 行殇 阅读(167) 评论(0) 推荐(0) 编辑

2015年1月19日

摘要: 1.基本作用 通常onSaveInstanceState()只适合用于保存一些临时性的状态,而onPause()适合用于数据的持久化保存。 在activity被杀掉之前调用保存每个实例的状态,以保证该状态可以在onCreate(Bundle)或者onRestoreInstanceState(Bu... 阅读全文
posted @ 2015-01-19 11:30 行殇 阅读(154) 评论(0) 推荐(0) 编辑

2015年1月15日

摘要: onPostOnCreate()和OnPostResme()这两个函数onPostResume() Called when activity resume is complete (after onResume has been called). Applications will general... 阅读全文
posted @ 2015-01-15 17:18 行殇 阅读(989) 评论(0) 推荐(0) 编辑

2014年11月7日

摘要: 1.int-->Integer new Integer(i);2.Integer-->int Integer i = new Integer(1); int k = i.intValue();3.int-->String 1.int i = ""+k; 2.i.toString(); 3.... 阅读全文
posted @ 2014-11-07 13:37 行殇 阅读(138) 评论(0) 推荐(0) 编辑

2014年10月30日

摘要: replace和replaceAll是JAVA中常用的替换字符的方法,它们的区别是:1)replace的参数是char和CharSequence,即可以支持字符的替换,也支持字符串的替换(CharSequence即字符串序列的意思,说白了也就是字符串);2)replaceAll的参数是regex,即... 阅读全文
posted @ 2014-10-30 13:48 行殇 阅读(369) 评论(0) 推荐(0) 编辑
摘要: 在android中,有一个容易遗忘的Html.fromhtml方法,意思是可以将比如文本框中的字符串进行HTML格式化,支持的还是很多的,但要注意的是要在string.xml中用去转义,比如:Java代码 teletype-style font. But no useforthe code tag!... 阅读全文
posted @ 2014-10-30 13:17 行殇 阅读(600) 评论(0) 推荐(0) 编辑
摘要: LayoutInflater作用是将layout的xml布局文件实例化为View类对象。获取LayoutInflater的方法有如下三种:?LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_... 阅读全文
posted @ 2014-10-30 13:09 行殇 阅读(568) 评论(0) 推荐(0) 编辑

2014年10月29日

摘要: 比如在arrays.xml里: Reboot Recovery BootLoader 在代码里获取:String item0 =this.getResources().getStringArray(R.array.reboot_item)[0];String item1 = this.getRes... 阅读全文
posted @ 2014-10-29 11:11 行殇 阅读(1891) 评论(0) 推荐(0) 编辑

导航