
Android
文章平均质量分 72
皮克桃在写代码
这个作者很懒,什么都没留下…
展开
-
带你详细了解 Android Lifecycle
Lifecycle 一个跟踪组件生命周期的东西原创 2023-04-05 13:59:56 · 1644 阅读 · 0 评论 -
SafeIterableMap
SafeIterableMap 他是google工程师在 Androidx 中提供的一个简单数据结构,非线程安全,以键值对方式存取数据,看似一个map,其底层是一个双向链表,每一个键值对被包装成一个 Entry 被保存。支持双向遍历,并且支持在迭代过程中直接对集合的修改(直接调用map的put 或者remove方法,比如添加删除,不能调用Iteratorr的remove方法)。原创 2023-03-24 17:22:00 · 641 阅读 · 1 评论 -
Android layer-list 中图片被拉伸问题
无图无真相,先上图: 其中 item 1~5 是正正常的,后面本来应该显示在右下角的icon 都被拉伸了。 代码如下:<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:reader="http...原创 2018-06-22 09:51:40 · 11381 阅读 · 0 评论 -
Android Studio Gradle: Implementation vs API dependency
升级到Android Studio 3.0 后有没有发现编译项目的速度提高了?为什么会这样呢?是因为Stuido 3.0 中支持了 Gradle plugin 3.0, Gradle plugin 3.0 在 dependencise 块中为我们带了一下新的API:compile 被api 所代替。provided被compileOnly 代替apk 被runtimeOnly代替引入了新的i原创 2018-01-03 16:24:46 · 1698 阅读 · 1 评论 -
Android 一次启动多个Activity (TaskStackBuilder)
引言startActivitysTaskStackBuilder引言在什么场景下我么需要一次启动多个Activity 呢?一般来说用的最多的还是notification。点击一个notification,启动App 内的某一个TargetActivity,在TargetActivity界面 按back button 或者其他方式 把TargetActivity finish掉后不会返回到Home原创 2017-09-21 17:37:07 · 8476 阅读 · 0 评论 -
Android: 通过 intent 启动 Activity
通过 intent 启动 ActivityIntent 种类Exported 属性Category总结Explicit Intent 启动 ActivityImplicit Intent 启动Activity通过 intent 启动 ActivityIntent 种类 Intent 有两种: Explicit intents 显示意图 通过指定明确的包名和类名来启动一原创 2017-09-01 12:01:26 · 980 阅读 · 0 评论 -
Activity 启动模式
FlagFLAG_ACTIVITY_NEW_DOCUMENTFLAG_ACTIVITY_MULTIPLE_TASKFLAG_ACTIVITY_RETAIN_IN_RECENTSFlagFLAG_ACTIVITY_NEW_DOCUMENT 此处document 这个单词实在是不知道怎么翻译才恰当,document 本意就是文档,文件的意思,本文展示就翻译成文档的意思吧,我觉得这样稍微准确一点原创 2017-09-13 17:09:20 · 1773 阅读 · 1 评论 -
Android 通过inputstream 加载非Drawable 文件夹下的 .9 path 图片
有时候我们想在其他地方加载 .9 path 图片,比如 assets 目录下,又或者从网上下载一个到sdcard 上,但是 bitmap.getNinePatchChunk() 总是 return null,而如果9path图片在drawable 文件下则可以。为什么会这样呢?是因为9path 图片有两种type,一种叫“source” 一种叫“compiled”. “source” 就是我们通过原创 2015-08-17 15:29:18 · 2181 阅读 · 0 评论 -
Android Actionar overflow 不显示的问题
关于Android Actionar overflow 不显示的问题原创 2015-03-17 11:40:30 · 744 阅读 · 0 评论 -
Android System.exit(code) and android.os.Process.killProcess(pid)或者发生RunTimeException 导致应用重启
关于 System.exit(code) and android.os.Process.killProcess(pid) 或者发生RunTimeException导致应用重启 的问题原创 2015-01-09 19:08:40 · 4347 阅读 · 1 评论 -
Android-App manifest-allowTaskReparenting
Whether or not the activity can move from the task that started it to the task it has an affinity for when that task is next brought to the front — "true" if it can move, and "false" if it must remain with the task where it started.原创 2014-12-22 19:48:59 · 990 阅读 · 0 评论 -
Android Bitmap.setDensity(int density) 和 BitmapDrawable.setTargetDensity()
关于Android Bitmap.setDensity 和BitmapDrawable.setTargetDensity() 的作用: Bitmap.setDensity:api文档时这样解释的:Specifies the density for this bitmap. When the bitmap is drawn to a Canvas that also has a原创 2015-01-06 12:33:28 · 7053 阅读 · 1 评论 -
Android WebView 闪屏问题
Android WebView 闪屏问题原创 2015-01-07 15:09:59 · 5109 阅读 · 1 评论