随笔分类 -  Android

摘要:1 public class DBOpenHelper extends SQLiteOpenHelper { 2 3 public DBOpenHelper(Context context) { 4 super(context, "itcast.db", null, 2)... 阅读全文
posted @ 2015-05-06 12:54 Colaless 阅读(231) 评论(0) 推荐(0)
摘要:1 /** 2 * 保存文件 3 * @param filename 文件名称 4 * @param content 文件内容 5 */ 6 public void save(String filename, String content) ... 阅读全文
posted @ 2015-05-06 12:26 Colaless 阅读(1863) 评论(0) 推荐(0)
摘要:1 public void saveToSDCard(String filename, String content)throws Exception { 2 if(Environment.getExternalStorageDirectory().equals(Env... 阅读全文
posted @ 2015-05-06 12:23 Colaless 阅读(255) 评论(0) 推荐(0)
摘要:1 public static List getPersons(InputStream xml) throws Exception{ 2 List persons = null; 3 Person person = null; 4 XmlPu... 阅读全文
posted @ 2015-05-05 23:52 Colaless 阅读(193) 评论(0) 推荐(0)
摘要:1 /** 2 * XmlSerializer xml序列化器 3 */ 4 //创建xmlSerializer 5 XmlSerializer serializer = Xml.newSerializer(); 6 File file = new File(MainActivity.this.... 阅读全文
posted @ 2015-05-01 15:57 Colaless 阅读(492) 评论(0) 推荐(0)
摘要://保存信息SharedPreferences sp = context.getSharedPreferences("config", Context.MODE_PRIVATE); //Context.MODE_PRIVATE 私有类型 Editor editor = sp.edit();//保存... 阅读全文
posted @ 2015-05-01 13:22 Colaless 阅读(592) 评论(0) 推荐(0)
摘要:/** * Button的四种写法 */ //第一种先获取button,然后给button添加监听事件,创建实现OnClickListener接口的类, //在接口类里实现button的响应事件。 Button callBtn = (Button) this.findViewById(R... 阅读全文
posted @ 2015-04-28 09:54 Colaless 阅读(1179) 评论(0) 推荐(0)
摘要:AndroidManifest.xml中, 在manifest节点下添加在application节点下添加//固定的 阅读全文
posted @ 2015-04-28 09:11 Colaless 阅读(121) 评论(0) 推荐(0)