排序:
默认
按更新时间
按访问量

Android消息机制,从Java层到Native层剖析

由Handler、MessageQueue、Looper构成的线程消息通信机制在Android开发中非常常用,不过大部分人都只粗浅地看了Java层的实现,对其中的细节不甚了了,这篇博文将研究Android消息机制从Java层到Native层的实现。消息机制由于更贴近抽象设计,所以整个结构更简单,只...

2017-10-08 16:37:33

阅读数:274

评论数:0

Android App启动流程

前言在使用Android手机时,我们总会启动各种各样的App以满足生活的各种需求,你是否想过,我们是怎样启动这些APP的?今天我将带着读者一起探索在Android系统中,一个App是如何被启动的。在开始分析之前,我们先回想下启动一个App的流程:Android系统桌面->点击应用图标->...

2017-02-28 12:34:51

阅读数:737

评论数:0

LeetCode题解:Maximum Subarray

Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,...

2016-03-04 09:22:17

阅读数:301

评论数:0

LeetCode题解:Kth Smallest Element in a BST

Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note: You may assume k is always valid, 1 ≤ k ≤ BST...

2016-03-04 09:16:50

阅读数:292

评论数:0

LeetCode题解:Linked List Cycle

/** * Definition for singly-linked list. * class ListNode { * int val; * ListNode next; * ListNode(int x) { * val = x...

2016-03-04 09:02:01

阅读数:278

评论数:0

LeetCode题解:Maximum Product of Word Lengths

Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assu...

2016-03-01 17:05:58

阅读数:314

评论数:0

LeetCode题解:Binary Tree Preorder Traversal

Given a binary tree, return the preorder traversal of its nodes’ values.For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3 ...

2016-03-01 16:49:40

阅读数:247

评论数:0

LeetCode题解:Missing Number

Given 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, ...

2016-03-01 16:48:25

阅读数:349

评论数:0

LeetCode题解:Bulb Switcher

There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every...

2016-03-01 16:37:47

阅读数:358

评论数:0

LeetCode题解:Best Time to Buy and Sell Stock with Cooldown

Say 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 profit. You may comple...

2016-03-01 15:51:54

阅读数:297

评论数:0

LeetCode题解:Product of Array Except Self

Given 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 nums exc...

2016-03-01 15:47:31

阅读数:483

评论数:0

LeetCode题解:Single Number III

Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements...

2016-03-01 15:32:49

阅读数:276

评论数:0

LeetCode题解:Single Number II

Given an array of integers, every element appears three times except for one. Find that single one.Note: Your algorithm should have a linear runtime...

2016-03-01 15:22:33

阅读数:271

评论数:0

LeetCode题解:Min Stack

Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) – Push element x onto stack. pop() – Remove...

2016-02-29 09:42:08

阅读数:341

评论数:0

LeetCode题解:First Bad Version

You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality ...

2016-02-29 09:31:00

阅读数:267

评论数:0

LeetCode题解:Range Sum Query - Immutable

Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.Example: Given nums = [-2, 0, 3, -5, 2, -1]sumR...

2016-02-28 15:17:37

阅读数:243

评论数:0

LeetCode题解:Binary Tree Paths

Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree:1 / \ 2 3 \ 5 All root-to-leaf paths a...

2016-02-28 15:03:06

阅读数:213

评论数:0

LeetCode题解:Remove Linked List Elements

Remove all elements from a linked list of integers that have value val.Example Given: 1 –> 2 –> 6 –> 3 –> 4 –> 5 –> 6, val = 6 Re...

2016-02-28 15:00:35

阅读数:175

评论数:0

LeetCode题解:Word Pattern

Given a pattern and a string str, find if str follows the same pattern.Here follow means a full match, such that there is a bijection between a lette...

2016-02-28 14:56:50

阅读数:317

评论数:0

LeetCode题解:Bulls and Cows

You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each tim...

2016-02-28 14:47:11

阅读数:302

评论数:0

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