- 博客(18)
- 收藏
- 关注
转载 Android N分屏模式Activity生命周期的变化
昨天Google发布了Android N Preview, balabala....我是用模拟器去验证的, 通过长按多任务窗口(口)进入分屏模式, 这里只进行了简单的测试, 不排除通过配置哪个参数, 生命周期有了其它变化,长按(口), Activity首先调用onMultiWindowChanged->onPause->onStop->onDestroy-&...
2016-03-11 10:28:00
468
转载 关于Android M RuntimePermission的问题
关于shouldShowRequestPermissionRationale的理解, 在onRequestPermissionsResult里如果用户拒绝了权限, 可以调用这个api, 返回true, 证明弹出了权限申请对话框, false则证明没有弹出(用户点击了'不再询问');另外, 申请权限是支持多权限一起申请的. 最好不要这样做.....如果用户拒绝了一个, 其它的都允许了,...
2015-11-20 17:43:00
167
转载 今天分享一个抽奖的类Lottery
/* * Copyright (C) 2014 Jason Fang ( ijasonfang@gmail.com ) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the...
2015-02-04 10:21:00
175
转载 今天再分享一个TextView内容风格化的类
/* * Copyright (C) 2014 Jason Fang ( ijasonfang@gmail.com ) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the...
2015-01-28 11:08:00
95
转载 写了个SharedPreferences的工具类(带加密)
/* * Copyright (C) 2014 Jason Fang ( ijasonfang@gmail.com ) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the...
2015-01-26 16:07:00
107
转载 关于MIUI悬浮窗权限问题的解决方案
先扯会....好久没写Blog了....这段时间有点小忙...瞎忙.....忙的自己都感觉都不应该.....严重影响了生活质量......生活的幸福指数!!!.....到现在还特么的单身!!!求介绍啊......MIUI是我个人非常喜欢的ROM....虽然有诸多的不爽....但是搞开发就能理解.....写好一个产品是多么的不易.....好多东西的不可控....精力的有限! 现在买手机...
2014-10-15 23:56:00
691
转载 关于dispatchTouchEvent, onInterceptTouchEvent, onTouchEvent的分发机制浅析
虽说这个问题不是很难...动动手就能看出答案...但是似乎不太容易理解...几次尝试把这个问题说明白....但是好像感觉说不明白....(顿时想起了那句话----说不明白就是自己还不明白! 我怎么可能不明白..so)这里面牵扯到Activity的dispatchTouchEvent, onTouchEvent以及ViewGroup的dispatchTouchevent, o...
2014-06-10 17:11:00
91
转载 关于File.getPath,File.getAbsolutePath,File.getCanonicalPath的区别
这个问题, 不了解一下还是挺恍惚它们之间的区别的.其实也挺简单的.getPath()-->>new File()时的路径getAbsolutePath()-->>当前路径+new File()时的路径getCanonicalPath()-->>规范路径真正意义的绝对路径这里面的文章主要还是只new File()的时...
2014-03-28 10:44:00
195
转载 android:layout_weight总有你不知道的用法.
都知道weight是权重的意思. 在布局中起到非常重要的作用. 但是这玩意不能嵌套使用, 而且只能使用在LinearLayout中. 下面说说它的几种用法(以下例子全为横排 注意android:layout_width值和android:layout_weight值的变化) 第一种, 最普遍的-----均分, weight的值越大, 占的空间越大.注意android:...
2014-01-28 11:30:00
148
转载 关于Service常驻内存不被清理的解决方法.
众所周知, Service是跑后台的. 但是有些Rom厂商把一键清理做的真是太好用了, 以至于一键清理变成了一种习惯, Service已经变的不再是Service了. 那为什么像诸如360, 微信, QQ...却可以傍山傍水.哦, 用错词了. 大家懂的. . 言归正传, android的系统进程分为五个等级, Foreground Process(前台进程), Visible ...
2014-01-26 10:13:00
243
转载 关于使用NotificationComat导致android2.3及以下版本无法显示自定义布局的解决方法....
大伙都知道 android-support-v4为我们提供了很多兼容的解决方案, 其中就有关于通知栏的.NotificationCompat, 顺利成章操刀显示通知.eg:Intent intent = new Intent();PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, in...
2013-12-16 15:51:00
83
转载 如何在有实体键的情况下全部显示ActionBar的Menu?
大伙都知道, 在老版本手机, 以及部分的新手机上都还残留实体键, 有了这些实体键, 默认菜单是用实体菜单键呼出的, 尽管你把android:showAsAction="always"那也是没有用的.经过几次实验, 终于勉强解决了这个问题, 如果有更好的方案, 还望留言探讨. 1 @Override 2 public boolean onCreateOptio...
2013-10-31 10:29:00
81
转载 真机下, 如何在File Explorer里看data下的数据?
首先手机得Root , 你如果想单个单个的看, root explorer可以设置Permission Other下的两个权限点上就ok了.如果想看到所有的, 即子目录也可以看到, 只需要adb root之后在adb remount;转载于:https://www.cnblogs.com/fangyucun/p/3333010.html...
2013-09-22 14:11:00
152
转载 Android 读取<meta-data>元素中的数据
众所周知, 每个组件都有<meta-data>元素, 用于接收一些外部数据(eg: appKey), 那其中的值应该怎么读取呢.1> Application<application android:allowBackup="true" android:icon="@drawable/ic_launcher" ...
2013-09-09 11:47:00
236
转载 在升级了ADT22之后报java.lang.NoClassDefFoundError错误
右键项目名称-->>Build Path-->>Configure Build Path-->>在Order and Export中选中Android Private Libraries-->>OK最后点击Project-->>clean一下当前项目就ok了.(如果还是没有成功的话,就选中Order and Export...
2013-06-13 09:22:00
85
转载 在使用ListFragment的setEmptyText时报java.lang.IllegalStateException: Can't be used with a custom content v...
今天搞了好久, 才基本解决了这个问题. 1 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 android:layout_width="match_parent" 3 android:layout_height="match_parent" >...
2013-05-29 18:00:00
93
转载 关于Toast连点显示不及时的问题
有时候我们需要使用Toast显示信息,快了之后似乎不能及时显示我们想要弹出的信息, 因为Toast的显示是压栈的. 如果使用单例可解决这一问题.上代码, 很简单. 1 package com.fyc.util; 2 3 import android.content.Context; 4 import android.widget.Toast; 5 6 pu...
2013-05-25 11:23:00
147
转载 解析/res/xml下的xml文件
android xml目录下的文件主要用于设置界面的配置信息,但是我们也可以将一些东西存放到xml目录下,例如MIME TYPE, 废话不多说,直接上代码.<?xml version="1.0" encoding="utf-8"?><MimeTypes> <type extension=".3gp" mimetype="video/3g...
2013-05-10 15:06:00
528
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人