自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

cxcbupt

我的学习记录

转载 High-Order_functions_and_lambdas

Higher-Order Functions and Lambdas1 Higher-Order Functions A higher-order function is a function that takes functions as parameters, or returns a fun...

2020-01-06 14:26:58 41 0

转载 Services overview

1 Services overview A Service is an application component that can perform long-running operations in the background, and it doesn’t provide a user ...

2019-10-21 22:25:03 31 0

原创 Vim搜索

1 显示、不显示行号 :set nu :set nonu 2 搜索高亮显示 :set hlsearch hlsearch:highlight search 3 同时搜索多个关键字 多个关键字之间用“|”分隔 方法一 "/"后跟多个关键字,分隔关键字的“|”需转义,即“|”...

2019-10-21 14:29:13 35 0

转载 Understand Tasks and Back Stack--Defining launch modes

Defining launch modesUnderstand Tasks and Back Stack--Defining launch modes1、Using the manifest file"standard" (the default mode)"sing...

2019-10-13 16:55:01 42 0

转载 Java PECS

extends The wildcard declaration ofList<? extends Number> foo3means that any of these are legal assignments: List<? extends Number> fo...

2019-06-25 16:23:13 89 0

原创 IntentFilter匹配规则

1、Intent types Intent有两种类型,显式Intent和隐式Intent。 使用显式Intent启动的目标组件特别明确,而隐式Intent则需要能够匹配组件在AndroidManifest.xml中声明的&lt;intent-filter&gt;信息。 2、I...

2018-12-01 21:22:39 219 0

原创 Android 8.0 Oreo 形为变更之 Notification Channels

最近(2018年11月15日)在上传App升级包至Google Play时,遇到了如下问题: 即:当前App的Target API Level 为25(Android 7.1.1 Nougat),要求将App的Target API Level提升到26(Android 8.0 Oreo)或以...

2018-11-17 16:50:26 380 0

转载 持续提高 Android 应用的安全性与性能

为了提升App的安全性及性能,确保每个用户都能够获取最佳体验,Google对Android应用开发者提出了一些变更: 今天,我们想要和各位 Android 开发者简单说明一下三项变更,它们背后的原因,以及它们如何让 Android 设备运行得更加安全和流畅。 从 2018 下半年开始,Go...

2018-11-17 14:56:20 133 0

原创 Android Studio: Debug Android SDK Source Code

1&gt;查看当前设备的API Level 如图,设备Android版本为8.0.0。 2&gt;使用SDK Manager下载对应的Source Code 注意: a、勾选右下角的“Show Package Details”             b、勾选A...

2018-11-13 15:25:09 329 0

原创 Android Bundle--ArrayMap详解

Android 四大组件:Activity、Service、ContentProvider、Broadcast Receiver。 在Android App开发中,跟UI相关使用的最多的莫过于Activity了。 一个Activity 启动另一个Activity时,可以使用Intent,其包含...

2018-11-03 18:47:38 464 0

原创 Android Platform Codenames, Versions, API Levels, and NDK Releases

The code names match the following version numbers, along with API levels and NDK releases provided for convenience:https://source.android.com/setup/...

2018-06-28 16:04:05 92 0

转载 ScrollView’s handy trick--android:fillViewport="true"

ScrollView is one of Android’s most commonly used widget and is also one of the easiest to use. When something is too big to fit on screen, drop it i...

2018-03-26 17:25:34 141 0

转载 OK Http-Interceptors

Interceptors are a powerful mechanism that can monitor, rewrite, and retry calls. Here's a simple interceptor that logs the outgoing request a...

2018-02-06 11:24:42 228 0

转载 Android Architecture Components--Saving UI States

In cases where the UI data to preserve is simple and lightweight, you might use onSaveInstanceState()alone to preserve your state data. In cases wh...

2018-02-05 16:29:00 152 0

转载 Android内存泄漏总结

Android 内存泄漏总结 箫鉴哥 2016-01-19 13:44:26 浏览42979 评论10 android 性能优化 阿里技术协会 内存管理 内存泄漏 摘要: Android 内存泄漏总结 内存管理的目的就是让我们在开发中怎么有效的避免我们的应用出现内存泄漏的问题...

2017-12-29 16:14:26 180 0

转载 单例-双重检查锁定与延迟初始化

在java程序中,有时候可能需要推迟一些高开销的对象初始化操作,并且只有在使用这些对象时才进行初始化。此时程序员可能会采用延迟初始化。但要正确实现线程安全的延迟初始化需要一些技巧,否则很容易出现问题。比如,下面是非线程安全的延迟初始化对象的示例代码: public class UnsafeLazy...

2017-12-22 13:58:21 224 0

原创 OkHttp Source Code Analyse (Part one)

OkHttp  An HTTP & HTTP/2 client for Android and Java applications From:http://square.github.io/okhttp/ Example: OkHttpClient client = new...

2017-12-07 11:40:36 148 0

转载 Method References

From:https://docs.oracle.com/javase/tutorial/java/javaOO/methodreferences.html Kinds of Method References There are four kinds of method references: ...

2017-11-14 15:43:39 156 0

转载 Syntax of Lambda Expressions

A lambda expression consists of the following: A comma-separated list of formal parameters enclosed in parentheses. The CheckPerson.test method con...

2017-11-14 10:43:09 138 0

转载 Android Studio--Read garbage collection messages

Sometimes when a garbage collection event occurs, they're printed to logcat. For more detail about your app's memory, use the Memory Profi...

2017-11-03 17:55:42 200 0

转载 TCP Connection Establishment Process: The "Three-Way Handshake"

Normal Connection Establishment: The "Three Way Handshake" To establish a connection, each device must send a SYN and receive an ACK for i...

2017-10-20 10:54:22 329 1

转载 Java 对象初始化过程

例子里总共测试了静态代码块,普通代码块,静态成员变量,普通成员 变量,构造器。分别在基类和派生类里各有一套。 public class ClassLog { private static final String TAG = "ClassLog"; publi...

2017-10-01 14:48:02 167 4

转载 display two or more logcat filters at the same time in Android Studio

up vote down votefavorite I have declared two LOG.i such as followings in my code: Log.i("pen", pen.toString); Log.i...

2017-09-25 17:30:49 204 0

转载 Android Studio / Intellij Tip of the Day

Android Studio / Intellij Tip of the Day: tools:attribute If you have ever entered some testing text in a TextView to see how it looks in the preview...

2017-08-24 14:06:28 927 0

转载 Android Studio Tip of the Day--Breakpoints

Android Studio Tip of the Day--Breakpoints

2017-08-23 17:50:59 361 0

转载 Showing a Dialog Fullscreen or as an Embedded Fragment

You might have a UI design in which you want a piece of the UI to appear as a dialog in some situations, but as a full screen or embedded fragment in...

2017-07-24 19:52:29 296 0

原创 从fragment开始向上查找实现了某个接口的parent Fragment 或者 Activity

//从fragment开始向上查找实现了接口listenerClass的fragment或activity public T findInterfaceByClass(Fragment fragment, Class listenerClass) { if (listen...

2017-07-24 10:25:50 291 0

原创 Fragment 与DialogFragment 相互之间传递数据

场景: 步骤在FragmentA 中触发显示DialogFragmentB,并传递参数数据mA2B给DialogFragmentB,在DialogFragmentB获取该参数--mA2B。 步骤在DialogFragmentB中对传递的参数mA2B进行一些处理得到结果mB2A,最后点击“完成”,需...

2017-06-20 11:28:42 5044 3

转载 你所不知道的Android Studio调试技巧

首先,来看看Android studio中为我们提供的调试面板(标准情况下): 这里写图片描述 点击右上角Restore ‘Threads’View可先展示目前相关的线程信息: 这里写图片描述 android studio大体为我们提供了7个...

2017-05-26 16:37:58 408 0

原创 Android 如何快速定位当前页面是哪个Activity or Fragment

在日常需求开发中,经常碰到不太熟悉的模块,如何快速定位相应页面对应的Activity/Fragment ?   (1)查看当前Activity  :adb shell "dumpsys window w | grep name=" (2)查看当前栈顶的Activity :...

2017-05-11 11:21:15 8673 3

转载 Helper class for creating pools of objects.

/* * Copyright (C) 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may n...

2017-05-04 11:34:31 252 0

转载 Positions in RecyclerView

Positions in RecyclerView: RecyclerView introduces an additional level of abstraction between the RecyclerView.Adapter and RecyclerView.LayoutMana...

2017-03-30 16:24:13 200 0

转载 Set "gravity" attribute to a RelativeLayout not working

How gravity affects the subviews is shown in the image below. I resized the widths of all the subviews so that what is happening is more clear....

2017-03-07 18:28:39 250 0

转载 Notifications --- Preserving Navigation when Starting an Activity

When you start an Activity from a notification, you must preserve the user's expected navigation experience. Clicking Back should take the user...

2017-01-20 10:58:27 254 0

转载 Using the RecyclerView

OverviewThe RecyclerView is a new ViewGroup that is prepared to render any adapter-based view in a similar way. It is supposed to be the successor of...

2017-01-17 16:40:17 368 0

转载 Size, Padding and Margins

The size of a view is expressed with a width and a height. A view actually possess two pairs of width and height values. The first pair is known...

2017-01-16 15:31:11 403 0

原创 Google Android 原生Rom 下载地址及刷机教程--Factory Images for Nexus and Pixel Devices

Google Android 原生Rom 下载地址及刷机教程 详见链接:https://developers.google.com/android/images#hammerheadkrt16m

2017-01-13 17:48:48 44214 2

转载 Broadcasts -----Security considerations and best practices

Here are some security considerations and best practices for sending and receiving broadcasts: If you don't need to send broadcasts to comp...

2017-01-06 11:46:22 243 0

转载 Requesting Permissions at Run Time

Beginning in Android 6.0 (API level 23), users grant permissions to apps while the app is running, not when they install the app. This approach strea...

2016-12-29 10:34:22 210 0

转载 Things That Cannot Change

Sometimes a developer will make a change to an application that has surprising results when installed as an update to a previous version — shortcuts ...

2016-12-26 13:21:21 158 0

提示
确定要删除当前文章?
取消 删除