732003684

导航

2013年3月5日 #

listview里子项有按钮的情况

摘要: 你自定义按钮:public class MyButton extends Button { public DontPressWithParentImageView(Context context, AttributeSet attrs) { super(context, attrs); } @Override public void setPressed(boolean pressed) { // If the parent is pressed, do not set to pressed. if (pressed && ((... 阅读全文

posted @ 2013-03-05 16:40 732003684 阅读(203) 评论(0) 推荐(0) 编辑

消息推送(使用notification来更新显示)

摘要: package com.text.ac;import android.app.Notification;import android.app.NotificationManager;import android.app.PendingIntent;import android.app.Service;import android.content.Context;import android.content.Intent;import android.os.IBinder;import android.widget.Toast;public class MessageService extend 阅读全文

posted @ 2013-03-05 16:16 732003684 阅读(581) 评论(0) 推荐(0) 编辑

点击屏幕其他部分进行退出,或者自定义popupwindow退出

摘要: @Override public boolean onTouchEvent(MotionEvent event){ finish(); return true; }mMenuView.setOnTouchListener(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { int height = mMenuView.findViewById(R.i... 阅读全文

posted @ 2013-03-05 11:33 732003684 阅读(299) 评论(0) 推荐(0) 编辑

Android App调试内存泄露之Cursor篇

摘要: http://www.jb51.net/article/31999.htm 阅读全文

posted @ 2013-03-05 11:06 732003684 阅读(103) 评论(0) 推荐(0) 编辑

注意数据库使用

摘要: 对于Android程序员来说平时开发Android应用很多地方需要我们注意,下面是通过浏览大部分源码易出错的地方。 一、数据库的Cursor 对于AndroidSQLite数据库封装的查询返回对象Cursor来说比较容易出错的有 1.Cursor返回可能为null 如果query返回的Cursor对象为空,执行cursor的任何方法肯定有空指针异常了,这点Android的代码有40%都没有注意到。 2.Cursor返回为0 我们仅仅判断不为空还不行,如果Cursor的对象为0,执行了moveToFirst();这样的方法就比较尴尬了,这点Android开发网格外提示大家注意。 ... 阅读全文

posted @ 2013-03-05 11:03 732003684 阅读(145) 评论(0) 推荐(0) 编辑

番茄工作法总结

摘要: 1、数据库操作2、定时器和后台服务(在F:\java\MyTomato) 阅读全文

posted @ 2013-03-05 10:52 732003684 阅读(113) 评论(0) 推荐(0) 编辑

service 和 AsyncTask的区别

摘要: In some cases it is possible to accomplish the same task with either anAsyncTaskor aServicehowever usually one is better suited to a task than the other.AsyncTasks are designed for once-off time-consuming tasks that cannot be run of the UI thread. A common example is fetching/processing data when a 阅读全文

posted @ 2013-03-05 09:36 732003684 阅读(537) 评论(0) 推荐(0) 编辑