自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

z_zhaojun的博客

机会只会留给有准备的人

  • 博客(74)
  • 资源 (14)
  • 问答 (3)
  • 收藏
  • 关注

原创 回顾:树的几种迭代遍历方式

PS:文章最后附上完整代码一、中序遍历List<Integer> inOrder(BTree root) { List<Integer> result = new ArrayList<>(); Stack<BTree> stack = new Stack<&a

2018-05-09 19:56:50 2257

原创 Andrioid进程保护

这篇博文主要是关于进程保活的应用,通过对网上各种进程保活方式的学习,自己理解后做汇总、优化、简单封装。进程保活,主要就为了加强你写的app在手机上的生存能力,降低被手机干掉的几率。当然,如果想要完全保证app不被杀死,那是不可能的(因为就是你再厉害,也厉害不过手机厂商),所以只能是尽量提高app的存活几率。下面将通过‘AIDL +JobS

2017-08-08 15:53:52 2201

原创 leetcode:144. Binary Tree Preorder Traversal

转载请注明出处:z_zhaojun的博客 原文地址 题目地址 Binary Tree Preorder TraversalGiven a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3},return [1,2,3].思路:优先添

2016-03-19 22:09:45 1602

原创 leetcode:41. First Missing Positive (Java)

转载请注明出处:z_zhaojun的博客 原文地址 题目地址 First Missing PositiveGiven an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algo

2016-03-13 15:28:32 1648 1

原创 leetcode:268. Missing Number(Java)解答

转载请注明出处:z_zhaojun的博客 原文地址 题目地址 Missing NumberGiven an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.For example,Given nums = [0, 1, 3

2016-03-11 22:07:30 2783

原创 leetcode:122. Best Time to Buy and Sell Stock II(java)解答

转载请注明出处:z_zhaojun的博客 原文地址 题目地址 Best Time to Buy and Sell Stock IISay you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum pro

2016-03-05 17:43:02 1839

原创 leetcode:121. Best Time to Buy and Sell Stock(Java)解答

转载请注明出处:z_zhaojun的博客 原文地址 题目地址 Best Time to Buy and Sell Stock My Submissions QuestionSay you have an array for which the ith element is the price of a given stock on day i.If you were only permit

2016-03-05 17:14:05 2377

原创 leetcode:238. Product of Array Except Self(Java)解答

转载请注明出处:z_zhaojun的博客 原文地址 题目地址 Product of Array Except SelfGiven an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of

2016-03-05 14:14:02 1751

转载 ThreadLocal详解

ThreadLocal是什么早在JDK 1.2的版本中就提供java.lang.ThreadLocal,ThreadLocal为解决多线程程序的并发问题提供了一种新的思路。使用这个工具类可以很简洁地编写出优美的多线程程序。ThreadLocal很容易让人望文生义,想当然地认为是一

2016-01-16 20:35:53 1011 1

原创 leetcode:283. Move Zeroes(Java)解答

转载请注明出处:z_zhaojun的博客 原文地址:http://blog.csdn.net/u012975705题目地址:https://leetcode.com/problems/move-zeroes/ Move ZeroesGiven an array nums, write a function to move all 0's to the end of it while

2016-01-10 21:05:39 2259 1

原创 leetcode:119. Pascal's Triangle II(Java)解答

转载请注明出处:z_zhaojun的博客 原文地址:http://blog.csdn.net/u012975705/题目地址:https://leetcode.com/problems/pascals-triangle-ii/Pascal’s Triangle IIGiven an index k, return the kth row of the Pascal's tri

2016-01-10 17:52:58 2399

原创 leetcode:142. Linked List Cycle II(Java)解答

转载请注明出处:z_zhaojun的博客 原文地址:http://blog.csdn.net/u012975705 题目地址:https://leetcode.com/problems/linked-list-cycle-ii/Linked List Cycle IIGiven a linked list, return the node where the cycle be

2015-12-27 16:36:19 2765 1

原创 leetcode:82. Remove Duplicates from Sorted List II(Java)解答

转载请注明出处:z_zhaojun的博客 原文地址:http://blog.csdn.net/u012975705 题目地址:https://leetcode.com/problems/reverse-linked-list-ii/Remove Duplicates from Sorted List IIGiven a sorted linked list, delete all

2015-12-27 00:18:19 1950 1

原创 leetcode:92. Reverse Linked List II(Java)解答

转载请注明出处:z_zhaojun的博客 原文地址:http://blog.csdn.net/u012975705 题目地址:https://leetcode.com/problems/reverse-linked-list-ii/Reverse Linked List IIReverse a linked list from position m to n. Do it in-place an

2015-12-26 16:14:34 2617

转载 解决在onCreate()过程中获取View的width和Height为0的4种方法

1、监听Draw/Layout事件:ViewTreeObserverViewTreeObserver监听很多不同的界面绘制事件。一般来说OnGlobalLayoutListener就是可以让我们获得到view的width和height的地方.下面onGlobalLayout内的代码会在View完成La

2015-12-15 19:15:18 1350 1

转载 Android 操作系统的内存回收机制

Android APP 的运行环境      Android 是一款基于 Linux 内核,面向移动终端的操作系统。为适应其作为移动平台操作系统的特殊需要,谷歌对其做了特别的设计与优化,使得其进程调度与资源管理与其他平台的 Linux 有明显的区别。主要包含下面几个层次:Application Framework      Application Framework 将整个操作系统分隔成两个部分。对

2015-12-10 18:04:25 3134 1

原创 自定义SectionAdapter显示数据

前言之前在项目中需要在一个ScrollView中显示2个不同类型的列表,因为就2个列表,所以偷了下懒:直接使用的2个ListView来显示。写完之后怎么看怎么别扭,今天抽空学习写了个SectionAdapter,mark下。实现效果主要代码pa

2015-12-09 16:41:32 2624

转载 java克隆对象clone()的用法和作用

内容摘要若需修改一个对象,同时不想改变调用者的对象,就要制作该对象的一个本地副本。这也是本地副本最常见的一种用途。若决定制作一个本地副本,只需简单地使用clone()方法即可。Clone是“克隆”的意思,即制作完全一模一样的副本。这个方法在基础类Object中定义成“protected”(受保护)模式。但在希望克隆的任何衍生类中,必须将其覆盖为“public”模式。例如,标准库类Vector覆盖了c

2015-12-09 10:02:09 24444 2

转载 JAVA中字符串比较equals()和equalsIgnoreCase()的区别

1、使用equals( )方法比较两个字符串是否相等。它具有如下的一般形式:boolean equals(Object str)这里str是一个用来与调用字符串(String)对象做比较的字符串(String)对象。如果两个字符串具有相同的字符和长度,它返回true,否则返回fa

2015-12-04 15:40:17 979

转载 每个人都应该知道的14个电脑使用技巧

来源:编程派源网址:http://codingpy.com/article/14-best-computer-tricks-everyone-should-know/ <div class="article-content"> <p>最近,Reddit网站有一个话题引起了大家的热烈讨论,话题

2015-12-02 10:30:15 1094

原创 判断App整体处于前台还是后台

转载请注明转自:[noyet12的博客](http://blog.csdn.net/u012975705) 博客原址:http://blog.csdn.net/u012975705上篇博客说道,在项目中使用Notification,想要的效果是在app退出前台工作时拉取后台数据,发现新动态则在通知栏提示用户。要达到这个效果,就必须判断当前app是否处于前台工作,下面给出判断方法。 publi

2015-11-30 11:26:05 3849 8

原创 Android——自定义通知栏使用

Android中通知栏的使用,还是刚学Android时玩过,后面一直没机会用到,今天做项目的时候用到了,这里mark下。

2015-11-27 17:46:37 2405

原创 Android中防止重复点击的小技巧

PS: 好久没有写过博客了,不经意间看到这篇在我接触Android不久时写的文章,现在看来确实挺粗糙的(有点看不下去了。。),这里写写我刚想到的另一种思路吧

2015-11-26 20:45:46 7633 3

转载 Android WebView页面加载优化

目前webapp越来越多,体验也越来越好,为了能够更好的使用WebView展示出流畅的的页面,可以从以下几点做优化:WebView缓存资源文件本地存储减少耗时操作客户端UI优化可能有人会说了,为什么不做成native的呢,这样就不用那么的麻烦了。如果我需要加载的内容都是静态的,

2015-11-25 15:13:48 3184 2

原创 解决ScrollView或ListView中嵌套ListView引起的冲突

转载请注明:[noyet12的博客](http://blog.csdn.net/u012975705)在ScrollView或ListView等滑动控件中嵌套ListView时,往往会导致ListView显示不完整,只显示一条数据,想使ListView显示完整可以通过重写ListView的onMeasure方法来解决:

2015-11-25 11:45:18 5239 2

转载 Android Looper详解

下面也有多线程的概念,在C/C++中,子线程可以是一个函数, 一般都是一个带有循环的函数,来处理某些数据,优先线程只是一个复杂的运算过程,所以可能不需要while循环,运算完成,函数结束,线程就销毁。对于那 些需要控制的线程,一般我们都是和互斥锁相互关联,从而来控制线程的进

2015-11-24 20:26:58 3111 2

原创 ScrollView拉到尽头时出现阴影的解决方法

/** * *转载请注明:[noyet12的博客](http://blog.csdn.net/u012975705) *博客原址:http://blog.csdn.net/u012975705 * */想要解决使ScrollView拉到尽头时不出现阴影,需要在布局中添加如下代码:

2015-11-24 12:07:12 3298

转载 Android 触摸及手势操作GestureDetector

现在的智能手机不敢说百分百的都是触摸屏,也应该是百分之九九以上为触摸屏了,触摸屏为我们操作无键盘、无鼠标的手机系统带来了很多的便利。当用户触摸屏幕时会产生很多的触摸事件,down、up、move等等。View类有个View.OnTouchListener内部接口,通过重写他的onTouch(View v, MotionEvent event)方法,我们可以处理一些touch事件,如下:public

2015-11-24 11:08:40 1947

原创 Android动画的fillAfter属性

转载请注明:[noyet12的博客](http://blog.csdn.net/u012975705)博客原址:http://blog.csdn.net/u012975705/article/details/49998813想要Android中fillAfter属生效,有2种写法直接在代码中设置:animation.setFillAfter(true);在xml中设置,注意了:必须在中设置,否则无

2015-11-23 17:48:54 2415

转载 Android中Bitmap和Drawable详解

一、相关概念1、Drawable就是一个可画的对象,其可能是一张位图(BitmapDrawable),也可能是一个图形(ShapeDrawable),还有可能是一个图层(LayerDrawable),我们根据画图的需求,创建相应的可画对象2、Canvas画布,绘图的目的区域,用于绘图3、Bitmap位图,用于图的处理4、Matrix矩阵

2015-11-23 15:29:57 2184 2

原创 Android 绘图机制:canvas初解

Canvas 即“画布”的意思,在Android中用其来进行2D绘画。在使用canvas来进行绘图时,一般都会自定义一个View来重写它的onDraw方法

2015-11-23 11:40:16 2654

转载 单例模式的七种写法

转自:http://cantellow.iteye.com/blog/838473第一种(懒汉,线程不安全):public class Singleton { private static Singleton instance; private Singleton (){} public static Singleton getInstance() { if (inst

2015-11-20 11:22:39 2144 4

原创 Service中onStartCommand方法返回值的探索

onStartCommand方法的返回值 有4种:START_STICKY、START_NOT_STICKY、START_REDELIVER_INTENT、START_STICKY_COMPATIBILITY。 下面通过结合demo测试结果来解释每种返回值所代表的意义。

2015-11-20 10:55:26 5795 1

转载 Android的BroadcastReceiver和EventBus区别是什么

转自图灵社区:http://www.ituring.com.cn/article/198897?utm_source=tuicool BroadcastReceiver是什么鬼?在Android中广播分为两个方面:广播发送者和广播接收者,通常情况下,BroadcastReceiver指的就是广播接收者(广播接收器)。  EventBus又是什么鬼呢?EventBus是一个发布 / 订阅的事件总

2015-11-19 17:08:17 2255

转载 Java中的Timer和TimerTask在Android中的用法

转自:http://blog.csdn.net/zuolongsnail/article/details/8168689 <html xmlns="http://www.w3.org/1999/xhtml">在开发中我们有时会有这样的需求,即在固定的每隔一段时间执行某一个任务。比如UI上的控件需要随着时间改变,我们可以使用Java为我们提供的计时器的工具类,即Timer和TimerTask。 T

2015-11-18 16:37:06 1654 1

转载 加快Android Studio的编译速度

转自:http://www.jianshu.com/p/c27ae1019225 从Eclipse切换到Android Studio后,感觉Android Studio的build速度比Eclipse慢很多, 以下几个方法可以提高Android Studio的编译速度使用Gradle 2.4Gradle 2.4对执行性能有很大的优化,但Android Studio现在默认使用的是Gradle 2

2015-11-13 20:08:30 2053 1

原创 WebView使用大全

转载请注明转自:noyet12的博客 博客原址:http://blog.csdn.net/u012975705简单介绍WebView是Android中能加载显示网页的控件,可以将其视为一个浏览器。在使用WebView之前必须在AndroidManifest.xml文件中添加权限:<uses-permission android:name="android.permission.INTERNET"

2015-11-13 10:50:46 2372

转载 创建GitHub技术博客全攻略

转自:http://blog.csdn.net/renfufei/article/details/37725057/ 说明: 首先,你需要注册一个 github 账号,最好取一个有意义的名字,比如姓名全拼,昵称全拼,如果被占用,可以加上有意义的数字.本文中假设用户名为 tiemaocsdn1. 注册账号:地址: https://github.com/输入账号、邮箱、密码,然后点击注册按

2015-11-12 14:15:51 1203

原创 Android中实现图片平移、缩放、旋转同步进行

转载请注明转自:[noyet12的博客](http://blog.csdn.net/u012975705)博客原址:http://blog.csdn.net/u012975705/article/details/49797911源码下载地址:(github)https://github.com/noyo/RotateZoomImageView(csdn)http://download.csdn.net/det

2015-11-12 13:35:11 7090 6

原创 Android注解式绑定控件BindView

转载请注明 出处:http://blog.csdn.net/u012975705/article/details/49637401Android注解式绑定控件BindView

2015-11-04 14:20:25 26939

Android进程保活源码

博文地址:http://blog.csdn.net/u012975705/article/details/76911987

2017-08-09

Android进程保活Demo

关于进程保活的一个简单封装 demo

2017-08-08

SectionAdapterDemo源码

SectionAdapterDemo源码 Section Adapter Demo 源码 section 博客:http://blog.csdn.net/u012975705

2015-12-09

Source insight 3破解版

Source insight 3 破解版

2015-12-02

对Service中onStartCommand方法返回值的探索 源码

“对Service中onStartCommand方法返回值的探索”一文源码 博客地址:http://blog.csdn.net/u012975705/article/details/49932783

2015-11-19

Android中实现图片平移、缩放、旋转同步进行 源码

Android中实现图片平移、缩放、旋转同步进行 源码 博客地址:http://blog.csdn.net/u012975705/article/details/49797911

2015-11-12

Android 图片平移、旋转、缩放demo源码

Android 图片平移、旋转、缩放demo源码

2015-11-12

类似网购电影票的GridView选择器

类似网购电影票的GridView选择器 源码

2015-11-01

google gosn工具包

Google的Gson库,用来进行object和json的相互转换

2015-09-27

聊天室服务器代码

聊天室ChatRoom app服务器代码

2015-09-26

EventBus2.4.jar

开源库EventBus,可以很方便的帮助我们实现观察者模式

2015-09-16

starUML2.0

starUML2.0:免费编写UML的的工具,使用的事UML2.0版本,适合Java相关的开发者使用

2015-09-15

android api文档

最新android api中文完整文档

2015-05-20

人机交互复习

人机交互复习提纲

2014-03-26

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

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