04 2016 档案

摘要:第二种方式修改,选择eclipse菜单中【file】》》【properties】, 这种方式是可以设置eclipse的默认编程语言的 对java类定义编程语言格式,选中java类,使用快捷键【ALT+Enter】 第二种方式修改,选择eclipse菜单中【file】》》【properties】, 这 阅读全文
posted @ 2016-04-29 12:23 gentspy 阅读(149) 评论(0) 推荐(0)
摘要:SystemClock.elapsedRealtime() Returns milliseconds since boot,including time spent in sleep. 阅读全文
posted @ 2016-04-29 10:37 gentspy 阅读(2309) 评论(0) 推荐(0)
摘要:public class HttpUtil { public static void sendHttpRequest(final String address, final HttpCallbackListener listener) { new Thread(new Runnable() { @O 阅读全文
posted @ 2016-04-29 09:26 gentspy 阅读(172) 评论(0) 推荐(0)
摘要:仔细读官方的API: Returns true if the string is null or 0-length. 因为你从EditText返回的是一个变量。如果这个变量本身为null值,那么你掉它的equals方法是要报错的。但是如果你调用TextUtils.isEmpty() 把这个变量作为参 阅读全文
posted @ 2016-04-28 21:02 gentspy 阅读(1571) 评论(0) 推荐(0)
摘要:【Android】ContentValues的用法 ContentValues 和HashTable类似都是一种存储的机制 但是两者最大的区别就在于,contenvalues只能存储基本类型的数据,像string,int之类的,不能存储对象这种东西,而HashTable却可以存储对象。 在忘数据库中 阅读全文
posted @ 2016-04-28 16:10 gentspy 阅读(233) 评论(0) 推荐(0)
摘要:public class CoolWeatherOpenHelper extends SQLiteOpenHelper { /** * Province表建表语句 */ public static final String CREATE_PROVINCE="create table Province 阅读全文
posted @ 2016-04-28 15:16 gentspy 阅读(150) 评论(0) 推荐(0)
摘要:Android Studio 相关 1,search Everywhere double Shift 2,Go to File Ctrl+Shirft+N 3.Recent Files Ctrl+E 4.Navigation Bar Alt+Home 5.Drop files here from E 阅读全文
posted @ 2016-04-27 17:46 gentspy 阅读(352) 评论(0) 推荐(0)
摘要:有时候我们一个项目会依赖于另一个项目的类库和资源,如下图项目pds-prrs依赖于pds-fw和pds-srv中的类和包 想要在pds-prrs中引入其他两个项目的方法为: 右键pds-prrs->build path->configure build path->project选项卡->.点击ad 阅读全文
posted @ 2016-04-26 16:59 gentspy 阅读(158) 评论(0) 推荐(0)
摘要:JAVA 中的Math.abs 一般什么情况需要用到 阅读全文
posted @ 2016-04-25 12:58 gentspy 阅读(324) 评论(0) 推荐(0)
摘要:都是空格,但是 是html中的空格的转义,而 是XSL中的。XSL并不认识 他会原样输出. 阅读全文
posted @ 2016-04-21 16:49 gentspy 阅读(453) 评论(0) 推荐(0)
摘要:"black"=>array( 0x000000),黑色 "maroon"=>array( 0x800000), 栗色 "green"=>array( 0x008000), 绿色 "olive"=>array( 0x808000), 橄榄色 "navy"=>array( 0x000080), 藏青色 阅读全文
posted @ 2016-04-21 10:48 gentspy 阅读(269) 评论(0) 推荐(0)
摘要:这里我们希望创建一个名为BookStore.db 的数据库,然后在这个数据库中新建一张Book表,表中有id(主键)、作者、价格、页数和书名等列。创建数据库表当然还是需要用建表语句的,这里也是要考验一下你的SQL 基本功了,Book 表的建表语句如下所示:create table Book (id 阅读全文
posted @ 2016-04-20 17:37 gentspy 阅读(120) 评论(0) 推荐(0)
摘要:让光标移到末端(这样文字就会向前显示) EditText et = ... String text = "text"; et.setText(text); et.setSelection(text.length()); 阅读全文
posted @ 2016-04-20 16:11 gentspy 阅读(113) 评论(0) 推荐(0)
摘要:6.2.2 从文件中读取数据类似于将数据存储到文件中,Context 类中还提供了一个openFileInput()方法,用于从文件中读取数据。这个方法要比openFileOutput()简单一些,它只接收一个参数,即要读取的文件名,然后系统会自动到/data/data/<package name> 阅读全文
posted @ 2016-04-20 15:51 gentspy 阅读(147) 评论(0) 推荐(0)
摘要:序的任何地方,只需要发出这样一条广播,就可以完成强制下线的操作了。那么毫无疑问,接下来我们就需要创建一个广播接收器了,新建ForceOfflineReceiver继承自BroadcastReceiver,代码如下所示:public class ForceOfflineReceiver extends 阅读全文
posted @ 2016-04-20 14:40 gentspy 阅读(590) 评论(0) 推荐(0)
摘要:public class MainActivity extends Activity {private IntentFilter intentFilter;private NetworkChangeReceiver networkChangeReceiver;@Overrideprotected v 阅读全文
posted @ 2016-04-20 12:04 gentspy 阅读(274) 评论(0) 推荐(0)
摘要:1.AS整理代码快捷键 ctl+alt+L 3. 另外,监听系统开机广播也是需要声明权限的,可以看到,我们使用<uses-permission>标签又加入了一条android.permission.RECEIVE_BOOT_COMPLETED 权限。 阅读全文
posted @ 2016-04-19 13:50 gentspy 阅读(525) 评论(0) 推荐(0)
摘要:package com.example.playaudiotest; import java.io.File; import android.app.Activity;import android.media.MediaPlayer;import android.os.Bundle;import a 阅读全文
posted @ 2016-04-13 16:44 gentspy 阅读(217) 评论(0) 推荐(0)
摘要:贴一下主要代码: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 5 阅读全文
posted @ 2016-04-13 13:36 gentspy 阅读(165) 评论(0) 推荐(0)
摘要:在android中提供了一种异步回调机制Handler,使用它,我们可以在完成一个很长时间的任务后做出相应的通知 handler基本使用: 在主线程中,使用handler很简单,new一个Handler对象实现其handleMessage方法,在handleMessage中提供收到消息后相应的处理方 阅读全文
posted @ 2016-04-08 16:36 gentspy 阅读(151) 评论(0) 推荐(0)
摘要:Android常用控件总结 Android常用控件总结 标签: Android布局 2013-07-10 20:48 610人阅读 评论(0) 收藏 举报 标签: Android布局 2013-07-10 20:48 610人阅读 评论(0) 收藏 举报 分类: android(79) 分类: an 阅读全文
posted @ 2016-04-08 09:46 gentspy 阅读(253) 评论(0) 推荐(0)