2014年4月10日

摘要: public class Test {public static void main(String[] args) { String s1="how are you"; String s2=new String("ni hao"); //System.out.println(s1.indexOf('h'));//查找Char字符在字符串中的索引 //System.out.println(s1.indexOf("are"));//查找String字符在字符串中的索引 System.out.println(s1.index 阅读全文
posted @ 2014-04-10 10:29 刘扬 阅读(211) 评论(0) 推荐(0)

2014年4月8日

摘要: ◆以多条件分割字符串时1 Pattern pattern = Pattern.compile("[, |]+");2 String[] strs = pattern.split("Java Hello World Java,Hello,,World|Sun");3 for (int i=0;i", Pattern.DOTALL);Matcher matcher = pattern.matcher("主页");String string = matcher.replaceAll("");System.out 阅读全文
posted @ 2014-04-08 18:21 刘扬 阅读(130) 评论(0) 推荐(0)
 
摘要: 加入了一些自己的理解.正则代表式里的一些特殊符号:\\ 反斜杠\t 间隔 ('\u0009')\n 换行 ('\u000A')\r 回车 ('\u000D')\d 数字 等价于[0-9]\D 非数字 等价于[^0-9]\s 空白符号 [\t\n\x0B\f\r]\S 非空白符号 [^\t\n\x0B\f\r]\w 单独字符 [a-zA-Z_0-9]\W 非单独字符 [^a-zA-Z_0-9]\f 换页符\e Escape\b 一个单词的边界\B 一个非单词的边界\G 前一个匹配的结束以上特殊符号可能不容易理解,下面会通过几个例子来表达他的使用.限 阅读全文
posted @ 2014-04-08 18:12 刘扬 阅读(189) 评论(0) 推荐(0)

2014年4月7日

摘要: package com.example.user_defined_view;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.view.animation.AlphaAnimation;import android.view.animation.Animation;import android.view.animation.AnimationSet;import android. 阅读全文
posted @ 2014-04-07 16:49 刘扬 阅读(324) 评论(0) 推荐(0)
 
摘要: package com.example.user_defined_view;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.view.animation.AlphaAnimation;import android.view.animation.Animation;import android.view.animation.AnimationSet;import android. 阅读全文
posted @ 2014-04-07 16:30 刘扬 阅读(319) 评论(0) 推荐(0)
 
摘要: package com.example.user_defined_view;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.view.animation.AlphaAnimation;import android.view.animation.AnimationSet;import android.widget.ImageView;public class MainActivi 阅读全文
posted @ 2014-04-07 16:20 刘扬 阅读(378) 评论(0) 推荐(0)

2014年4月4日

摘要: 布局文件: 代码示例演示:layout.addView(this.listView); // 增加组件this.slidingDrawer = (SlidingDrawer) super.findViewById(R.id.slidingdrawer);this.handle = (ImageView) super.findViewById(R.id.handle);// 取得组件this.slidingDrawer.setOnDrawerOpenListener( new OnDrawerOpenListenerImpl()); // 设置监听this.slidingDrawer.setOn 阅读全文
posted @ 2014-04-04 18:33 刘扬 阅读(515) 评论(0) 推荐(0)

2014年3月25日

摘要: 1 class MyAdapter extends ArrayAdapter { 2 private int mResource; 3 public MyAdapter(Context context, int textViewResourceId, 4 String[] objects) { 5 super(context, textViewResourceId, objects); 6 arrays = objects; 7 mResource = te... 阅读全文
posted @ 2014-03-25 19:13 刘扬 阅读(189) 评论(0) 推荐(0)