上一页 1 2 3 4 5 6 7 8 9 ··· 12 下一页
  2013年7月9日
摘要: #include "MyGame.h"#include #include #include #include int MyGame::totalparticipants = 0;int main(){ //char src[] = "1234567890"; //char src[] = "12345"; char src[] = "1234"; int len = strlen(src); //4 char dst[5]; int dlen = _countof(dst); //5 errno_t err = s 阅读全文
posted @ 2013-07-09 19:42 snowdrop 阅读(469) 评论(0) 推荐(0) 编辑
  2013年5月9日
摘要: for (int i = -129; i < 200; i++) { Integer a=i; Integer b=i; System.out.println("i=="+i+(a==b)); //1 }-128~127之间为true,之外为falsei==-129falsei==-128truei==-127truei==-126truei==-125truei==-124truei==-123truei==-122truei==-121truei==-120truei==-119truei==... 阅读全文
posted @ 2013-05-09 10:20 snowdrop 阅读(555) 评论(0) 推荐(0) 编辑
  2013年5月8日
摘要: c++ for(int i = 0; i < 10; i++) { for(int j = 0; j < 19-i; j++) { if (j < i) { cout << " "; //System.out.print(" "); } else { //if (j < 19 - 2i){ cout << "M"; //System.out.print("M"); } } cout << "\n"; }打印结果:MMMMMMMMMMMM 阅读全文
posted @ 2013-05-08 10:57 snowdrop 阅读(265) 评论(0) 推荐(0) 编辑
  2013年4月9日
摘要: 解决问题:如何得到一个可变参数的参数? 把参数用add方式存到集合里面,然后就可以通过iterator来遍历访问这些元素了。package javatest;import java.util.ArrayList;import java.util.Iterator;public class Hello { static int total = 0; private static ArrayList<Integer> alist = new ArrayList<Integer>(); public static void main(String args[]) { ... 阅读全文
posted @ 2013-04-09 09:53 snowdrop 阅读(154) 评论(0) 推荐(0) 编辑
  2013年3月19日
摘要: 法1:mSolo.sendKey(KEYEVENT.KEYCODE_BACK);法2:mSolo.goBack();法3:mInstrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK);法4:int keycode = KeyEvent.KEYCODE_BACK;KeyEvent keyEvent = new KeyEvent(KeyEvent.ACTION_DOWN,keycode);mInstrumentation.sendKeySync(keyEvent);方法4离手抬起来的时间点最近,约为10ms。方法4不行!手点下去:down = 阅读全文
posted @ 2013-03-19 15:01 snowdrop 阅读(618) 评论(0) 推荐(0) 编辑
  2013年3月12日
摘要: 需求: 需要一直监听某个变量的状态,直到其发生某个变化方法: 用Thread一直运行监听 如何让一个Thread一直运行? private class ThreadA extends Thread{ boolean flag = true; @Override public void run() {while (flag) { ..... if (XXX) { flag = false; }} } } 阅读全文
posted @ 2013-03-12 11:25 snowdrop 阅读(296) 评论(0) 推荐(0) 编辑
  2013年3月8日
摘要: 1.比如在Camera的test case里面想获取Gallery2中的某个抽象类类的一个protected变量。此抽象类在Camera 中实现。想访问Gallery2中的surfaceTextureScreenNail中的mRequestCount变量。protected int mRequestCount = 0;...在Camera中的CameraScreenNail.java extends surfaceTextureScreenNail直接访问变量mRequestcount = ...进行赋值引用。即:A包里面有个abstract B类,C包里面有个D extends B 类,和E 阅读全文
posted @ 2013-03-08 11:48 snowdrop 阅读(439) 评论(0) 推荐(0) 编辑
  2013年1月12日
该文被密码保护。 阅读全文
posted @ 2013-01-12 15:21 snowdrop 阅读(2) 评论(0) 推荐(0) 编辑
  2012年9月26日
摘要: private void rename(){Log.v(TAG,"rename---");boolean flag = new File("/sdcard/srxtest/22.txt").renameTo(new File("/sdcard/11.txt"));long L1 = new File("/sdcard/srxtest/1.txt").length();long L2= new File("/sdcard/srxtest/2.txt").length();long L3 = new 阅读全文
posted @ 2012-09-26 16:32 snowdrop 阅读(4018) 评论(0) 推荐(0) 编辑
  2012年7月4日
摘要: List<String> list = new ArrayList<String>(); list.add("a1"); list.add("a2"); 添加完之后,就有值了,法1:String[] str = list.toArray(new String[list.size()]);法2:String str[] = list.toArray(new String[]{}); 阅读全文
posted @ 2012-07-04 19:10 snowdrop 阅读(1654) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 12 下一页