摘要: 时间:2016年4月20日14:21:49static class MyHandler extends Handler { private WeakReference weakReference; public MyHandler(Context context) { weakReference = new WeakReference(contex... 阅读全文
posted @ 2016-04-20 14:32 五月的雨 阅读(641) 评论(0) 推荐(0) 编辑
摘要: 时间:2016-4-20 11:07:29使用Notifaction.Builder()触发时无反应,是否设置图标Icon? builder.setSmallIcon(R.drawable.ic_launcher);如果没有设置Icon就会出现触发时无反应。完整地code样式:Intent intent = new Intent(context, XXActivity.class); ... 阅读全文
posted @ 2016-04-20 14:32 五月的雨 阅读(757) 评论(0) 推荐(0) 编辑
摘要: 时间:2016-4-20 11:01:20描述:使用Notifaction时,使用到PendingIntent中使用intent传值的问题,接收Activity接收时获取到的内容为null。解决: flags有四个取值: int FLAG_CANCEL_CURRENT:如果该PendingIntent已经存在,则在生成新的之前取消当前的。 int FLAG_NO_CREATE:如... 阅读全文
posted @ 2016-04-20 14:32 五月的雨 阅读(2398) 评论(0) 推荐(0) 编辑
摘要: 时间:2016年4月19日09:54:27Activity中使用多个startActivityForResult时,在onActivityResult函数中对操作进行处理的框架:public static final int REQUEST_CODE_1 = 0x01;public static final int REQUEST_CODE_2 = 0x02;Intent intent_A = n... 阅读全文
posted @ 2016-04-20 14:32 五月的雨 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 时间:2016年3月18日18:30:14修改style中theme: 来自为知笔记(Wiz) 阅读全文
posted @ 2016-04-20 14:31 五月的雨 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 时间:2016年3月18日16:47:56/** * 自动适应高度的ViewPager * @author * */public class CustomViewPager extends ViewPager { public CustomViewPager(Context context) { super(context); } public CustomV... 阅读全文
posted @ 2016-04-20 14:31 五月的雨 阅读(1775) 评论(0) 推荐(0) 编辑
摘要: 时间:2016年4月18日13:31:38TextView中显示内容很多,需要生成滚动效果。textView.setMovementMethod(ScrollingMovementMethod.getInstance());来自为知笔记(Wiz) 阅读全文
posted @ 2016-04-20 14:31 五月的雨 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 时间:2016年3月7日16:14:52note:单位为像素。三个方法中都是根据Display来进行测量。//方法一:WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE); Display display = wm.getDefaultDisplay(); int width = disp... 阅读全文
posted @ 2016-04-20 14:30 五月的雨 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 时间:2016年3月18日13:35:54相同点: 两个文件夹下的文件都不会被编译成二进制文件,都会被原封不动的放到apk中。不同点: asset下的文件不会被映射到R文件中,raw下的文件会被映射到R文件中。 因为raw文件可以映射到R文件中,所以可以使用R.raw.xxx的方法去引用资源。 asset下可以有目录结构,raw下不能有目录结构。Since raw is a... 阅读全文
posted @ 2016-04-20 14:30 五月的雨 阅读(1883) 评论(0) 推荐(0) 编辑
摘要: 时间:2016年3月4日09:54:02IntentFilter过滤信息:action、category、dataaction: 1.Intent中的action必须能够和过滤条件中的action匹配,过滤条件中可以有多个action。 2.Intent中如果设置多个action则过滤条件中必须至少有同样数量的action。 3.如果Intent设置act... 阅读全文
posted @ 2016-03-04 11:05 五月的雨 阅读(946) 评论(0) 推荐(0) 编辑