摘要: 昨天Google发布了Android N Preview, balabala....我是用模拟器去验证的, 通过长按多任务窗口(口)进入分屏模式, 这里只进行了简单的测试, 不排除通过配置哪个参数, 生命周期有了其它变化, 长按(口), Activity首先调用onMultiWindowChange 阅读全文
posted @ 2016-03-11 10:28 小草房Jason 阅读(1203) 评论(0) 推荐(0) 编辑
摘要: 关于shouldShowRequestPermissionRationale的理解, 在onRequestPermissionsResult里如果用户拒绝了权限, 可以调用这个api, 返回true, 证明弹出了权限申请对话框, false则证明没有弹出(用户点击了'不再询问');另外, 申请权限是... 阅读全文
posted @ 2015-11-20 17:43 小草房Jason 阅读(371) 评论(0) 推荐(0) 编辑
摘要: /* * Copyright (C) 2014 Jason Fang ( ijasonfang@gmail.com ) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this... 阅读全文
posted @ 2015-02-04 10:21 小草房Jason 阅读(1235) 评论(0) 推荐(0) 编辑
摘要: /* * Copyright (C) 2014 Jason Fang ( ijasonfang@gmail.com ) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this... 阅读全文
posted @ 2015-01-28 11:08 小草房Jason 阅读(775) 评论(2) 推荐(0) 编辑
摘要: /* * Copyright (C) 2014 Jason Fang ( ijasonfang@gmail.com ) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this... 阅读全文
posted @ 2015-01-26 16:07 小草房Jason 阅读(1633) 评论(0) 推荐(0) 编辑
摘要: 先扯会....好久没写Blog了....这段时间有点小忙...瞎忙.....忙的自己都感觉都不应该.....严重影响了生活质量......生活的幸福指数!!!.....到现在还特么的单身!!!求介绍啊......MIUI是我个人非常喜欢的ROM....虽然有诸多的不爽....但是搞开发就能理解...... 阅读全文
posted @ 2014-10-15 23:56 小草房Jason 阅读(12048) 评论(16) 推荐(3) 编辑
摘要: 虽说这个问题不是很难...动动手就能看出答案...但是似乎不太容易理解...几次尝试把这个问题说明白....但是好像感觉说不明白....(顿时想起了那句话----说不明白就是自己还不明白! 我怎么可能不明白..so)这里面牵扯到Activity的dispatchTouchEvent, onTouch... 阅读全文
posted @ 2014-06-10 17:11 小草房Jason 阅读(783) 评论(0) 推荐(2) 编辑
摘要: 这个问题, 不了解一下还是挺恍惚它们之间的区别的.其实也挺简单的.getPath()-->>new File()时的路径getAbsolutePath()-->>当前路径+new File()时的路径getCanonicalPath()-->>规范路径真正意义的绝对路径这里面的文章主要还是只new File()的时候加入了"."和".."如何用了这2个. getAbsolutePath()就是如上面解释的一样.而getCanonicalPath()会把"."和".."翻译过来.就 阅读全文
posted @ 2014-03-28 10:44 小草房Jason 阅读(638) 评论(0) 推荐(0) 编辑
摘要: 都知道weight是权重的意思. 在布局中起到非常重要的作用. 但是这玩意不能嵌套使用, 而且只能使用在LinearLayout中. 下面说说它的几种用法(以下例子全为横排 注意android:layout_width值和android:layout_weight值的变化) 第一种, 最普遍的-----均分, weight的值越大, 占的空间越大.注意android:layout_width的值都为0dp 第二种, 占满剩余空间, 不管是否处在最后一个 第三种, 值越大占的空间越小, 值为同布局下其它控件的weight之和时,即消... 阅读全文
posted @ 2014-01-28 11:30 小草房Jason 阅读(10991) 评论(2) 推荐(1) 编辑
摘要: 众所周知, Service是跑后台的. 但是有些Rom厂商把一键清理做的真是太好用了, 以至于一键清理变成了一种习惯, Service已经变的不再是Service了. 那为什么像诸如360, 微信, QQ...却可以傍山傍水.哦, 用错词了. 大家懂的. . 言归正传, android的系统进程分为五个等级, Foreground Process(前台进程), Visible Process(可见进程), Service Process(服务进程), Background Process(后台进程), Empty Process(空进程), Service的进程处于第三个位置. 系统的回... 阅读全文
posted @ 2014-01-26 10:13 小草房Jason 阅读(6851) 评论(3) 推荐(0) 编辑
摘要: 大伙都知道 android-support-v4为我们提供了很多兼容的解决方案, 其中就有关于通知栏的.NotificationCompat, 顺利成章操刀显示通知.eg:Intent intent = new Intent();PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);NotificationCompat.Builder builder = new NotificationCompat.Builder(this);builder.. 阅读全文
posted @ 2013-12-16 15:51 小草房Jason 阅读(560) 评论(1) 推荐(0) 编辑
摘要: 大伙都知道, 在老版本手机, 以及部分的新手机上都还残留实体键, 有了这些实体键, 默认菜单是用实体菜单键呼出的, 尽管你把android:showAsAction="always"那也是没有用的.经过几次实验, 终于勉强解决了这个问题, 如果有更好的方案, 还望留言探讨. 1 @Override 2 public boolean onCreateOptionsMenu(Menu menu) { 3 // MenuItem menuSearch = menu.add(0, 1, 0, getString(R.string.menu_search)); 4 // ... 阅读全文
posted @ 2013-10-31 10:29 小草房Jason 阅读(620) 评论(1) 推荐(0) 编辑
摘要: 首先手机得Root , 你如果想单个单个的看, root explorer可以设置Permission Other下的两个权限点上就ok了.如果想看到所有的, 即子目录也可以看到, 只需要adb root之后在adb remount; 阅读全文
posted @ 2013-09-22 14:11 小草房Jason 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 众所周知, 每个组件都有元素, 用于接收一些外部数据(eg: appKey), 那其中的值应该怎么读取呢.1> Application ApplicationInfo info = null; try { info = getPackageManager() .getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA); } catch (NameNotFoundException e) { e.prin... 阅读全文
posted @ 2013-09-09 11:47 小草房Jason 阅读(4824) 评论(0) 推荐(0) 编辑
摘要: 运行->drivers->etc->hosts加入一行74.125.237.1 dl-ssl.google.comok!=================上述方法已经失效, 残忍的zf======================通过这个可以获得代理里面有很多..有有用的, 又没用的自己试====... 阅读全文
posted @ 2013-08-14 10:25 小草房Jason 阅读(4494) 评论(0) 推荐(0) 编辑
摘要: 右键项目名称-->>Build Path-->>Configure Build Path-->>在Order and Export中选中Android Private Libraries-->>OK最后点击Project-->>clean一下当前项目就ok了.(如果还是没有成功的话,就选中Order and Export中所有的, 然后再clean一下.) 阅读全文
posted @ 2013-06-13 09:22 小草房Jason 阅读(399) 评论(0) 推荐(1) 编辑
摘要: 今天搞了好久, 才基本解决了这个问题. 1 4 5 7 style="@style/MyListView" 8 android:layout_width="match_parent" 9 android:layout_height="match_parent"/>10 11 13 android:layout_width="wrap_content"14 android:layout_height="wrap_content"15 android:layout_grav... 阅读全文
posted @ 2013-05-29 18:00 小草房Jason 阅读(2231) 评论(1) 推荐(1) 编辑
摘要: 有时候我们需要使用Toast显示信息,快了之后似乎不能及时显示我们想要弹出的信息, 因为Toast的显示是压栈的. 如果使用单例可解决这一问题.上代码, 很简单. 1 package com.fyc.util; 2 3 import android.content.Context; 4 import android.widget.Toast; 5 6 public class ToastUtils { 7 8 private static Toast mToast; 9 10 public static void show(Context ctx, String ... 阅读全文
posted @ 2013-05-25 11:23 小草房Jason 阅读(1510) 评论(2) 推荐(0) 编辑
摘要: android xml目录下的文件主要用于设置界面的配置信息,但是我们也可以将一些东西存放到xml目录下,例如MIME TYPE, 废话不多说,直接上代码. ... 阅读全文
posted @ 2013-05-10 15:06 小草房Jason 阅读(809) 评论(0) 推荐(0) 编辑