摘要: public ToDoDB(Context context){ super(context, DATABASE_NAME, null, DATABASE_VERSION);}@Overridepublic void onCreate(SQLiteDatabase db){ /* 创建table */ String sql = "CREATE TABLE " + TABLE_NAME + " (" + FIELD_id + " INTEGER primary key autoincrement, " + " " + 阅读全文
posted @ 2011-08-04 15:22 坑爹2011 阅读(242) 评论(0) 推荐(0)
摘要: public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); /* 添加三个MENU */ menu.add(Menu.NONE, MENU_ADD, 0, R.string.strAddButton); menu.add(Menu.NONE, MENU_EDIT, 0, R.string.strEditButton); menu.add(Menu.NONE, MENU_DELETE, 0, R.string.strDeleteButton); return true; } 阅读全文
posted @ 2011-08-04 14:56 坑爹2011 阅读(164) 评论(0) 推荐(0)
摘要: 打电话的android.intent.action.CALL方法 Intent myIntentDial = newIntent("android.intent.action.CALL",Uri.parse("tel:"+strInput));发短信 //构造一个PendingIntent 对象并使用getBroadcast()广播,将PendingIntent 、电话、短信文字等参数传入sendTextMessage()方法发送短信 PendingIntent mPI = PendingIntent.getBroadcast(EX05_03.this, 阅读全文
posted @ 2011-08-04 10:18 坑爹2011 阅读(386) 评论(0) 推荐(0)
摘要: public static boolean isPhoneNumberValid(String phoneNumber) { boolean isValid = false; String expression = "^\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})$"; String expression2 ="^\\(?(\\d{2})\\)?[- ]?(\\d{4})[- ]?(\\d{4})$"; CharSequence inputStr = phoneNumber; Pattern pattern = P 阅读全文
posted @ 2011-08-04 09:46 坑爹2011 阅读(279) 评论(0) 推荐(0)
摘要: private String searchFile(String keyword){ String result=""; File[] files=new File("/").listFiles(); for( File f : files ){ if(f.getName().indexOf(keyword)>=0){ result+=f.getPath()+"\n"; } } if(result.equals("")) result="找不到文件"; return result;} 阅读全文
posted @ 2011-08-03 15:13 坑爹2011 阅读(90) 评论(0) 推荐(0)