`
sdkongkong
  • 浏览: 39251 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论
文章列表
在剖析该问题前请看如下代码 public static String bytes2HexString(byte[] b) {   String ret = "";   for (int i = 0; i < b.length; i++) {    String hex = Integer.toHexString(b[ i ] & 0xFF);    if (hex.length() == 1) {     hex = '0' + hex;    }    ret += hex.toUp ...
1 listview 项目无法获取点击事件 可能是因为条目里面有按钮或者checkbox , 需要在布局文件里把它们设置成android:focusable="false" 2 CheckBox 不要写成Checkbox 3 listview让屏幕滚动到某一条记录getListView().smoothScrollToPosition(index); fragment里好像只能用这种,普通Listview好像可以用setselection  , 好像还可以getListView().setTranscriptMode(ListView.TRANSCRIPT_MODE_NORM ...
要想在activity之间传递对象, 该对象必须实现Parcelable接口。必须按顺序实现写入和读出方法。 1 :实现这个方法进行写入 writeToParcel 2 : 定义这个对象实线读取public static final Parcelable.Creator<OrdinaryContent> CREATOR 3 : 要注意存入和读取的参数的顺序必须一致 代码示例: public class OrdinaryContent implements Parcelable{ private String id; private String work_content; ...
sticky 类型的广播会保存 上次广播的intent,  只要你注册到这个广播, 就可以直接获得上次的intent 。   Perform a sendBroadcast(Intent) that is "sticky," meaning the Intent you are sending stays around after the broadcast is complete, so that others can quickly retrieve that data through the return value ofregisterReceiver(Broadc ...
客户端 : public static String post( String actionUrl ,               Map < String , String > params , Map < String , File > files )               throws IOException           {               String BOUNDARY = java.util.UUID.randomUUID ( ).toString ( ) ;               String PREFIX = & ...
http://stackoverflow.com/questions/4838207/how-to-create-a-looper-thread-then-send-it-a-message-immediately http://www.iteye.com/topic/1118130 http://www.iteye.com/topic/1123141
package com.archer.calllog; import android.app.Activity; import android.content.Context; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.provider.CallLog.Calls; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatch ...
建议用拔苗助长法,直接以语言配合框架快速学习。 建议两本书Core Java + Effective Java (Joshua Bloch)。你说道你已经有一定的基础,如果有毅力把第二本书肯下来的话你就具有一定功力了。Effective Java II 一共有78个知识点,先啃他60个。 装个Eclipse,把随书release的范例import进去,一个一个尝试读懂,运行。 Java其实一点都不难,难的是掌握和运用基于Java的一些框架和工具,一般大路货有Struts/Spring/iBatis/Hibernate/Maven/Ant/Mysql/JSP。如果光有Java基础,不懂这些工具应 ...
第一次写android下的测试用例, 首先没有添加配置文件 之后有一个错误Test run failed: Test run failed to complete. Expected 1 tests, received 0 发现很多人碰到过,各种原因。有异常,有带参数的构造方法,有用了泛型的。 最后发现升级到2.3版本之后可以提示具体内容。 升级到2.3之后 发现提示No tests found in com.archer。。。 搜索发现测试用例函数的开头必须是小写的test否则会找不到测试用例。 改了之后还是不行, 最后发现是必须继承 AndroidTestCase public class ...
1 配置环境   安装cdt , 用cdt.zip   安装cygin, 选择下载好的插件包   配置ndk的编译环境, 把ndk-build 加到系统路径里面,通过配置/etc/profile 2  先定义 native方法 package com.itheima.samples; public class DataProvider { public native int add(int x, int y); public static native int sub(int x, int y); public native char add(char x, char y); publi ...
今天的主要内容是  分别用普通方式和SharedPreferences读取文件,xml 解析和生成,sqlite的增删改查。获取sd卡的大小 1 用普通方式存储和读取qq的用户名和密码 存 fos = context.openFileOutput("password.txt", Context.MODE_WORLD_READABLE); String content = account + ":" + password; fos.write(content.getBytes()); 读 FileInputStream fis = this.openFil ...
1 五种部局 LinearLayout  线性布局 AbsoluteLayout 据对布局 RelativeLayout  相对布局 FrameLayout  帧布局 类似div层 tablelayout 表格布局 2 adb 简单命令 adb version adb devices adb shell adb -s 制定连接那个设备 adb install  demo.apk adb uninstall [包名] adb kill-server adb start-server adb pull adb push 3 发短信         String number = send_numbe ...
Observer Design Patten Let’s design a system to see how observer design patten works. First we need a object to be watched , here it is one people. The people class look like: package test; import java.io.File; import java.net.URL; import org.dom4j.Document; import org.dom4j.DocumentException; impo ...
自己写的解析函数 private void readXml() { SAXReader reader = new SAXReader(); URL url = this.getClass().getClassLoader().getResource(filename); try { Document document = reader.read(url);   Element root = document.getRootElement();         for ( Iterator i = root.elementIterator(); i.hasNext(); ...
1: 2*8 最有效率的运算方式 2: a=3 b=8 交换a,b的值(不通过第三个数)
Global site tag (gtag.js) - Google Analytics