自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(12)
  • 资源 (1)
  • 收藏
  • 关注

原创 获取status bar的高度

private int getStatusBarheight() { try { Class clazz = Class.forName("com.android.internal.R$dimen"); Object obj = clazz.newInstance(); Field field = clazz.

2015-12-29 17:13:53 694

原创 使用清华镜像下载Android源码

1. 创建bin路径 macbookpro-2d30:~ xxx$ mkdir bin PATH=~/bin:$PATH2. 从清华镜像下载repo文件 macbookpro-2d30:bin xxx$ git clone git://aosp.tuna.tsinghua.edu.cn/android/git-repo.git 从git-repo文件下降re

2015-12-26 20:07:04 4683

原创 [Binary Search]Search Insert Position

Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.

2015-12-16 16:32:45 458

原创 ContentProvider启动时机问题简记

今天代码中用到了自定义的ContentProvider,除了在AndroidManifest.xml中的声明外:,应用侧的代码并没有显示启动MyProvider的逻辑。1. 那么ContentProvider是什么时候启动起来的?MyProvider的onCreate方法的执行调用栈可知:MyContentProvider.onCreate() line: 47MyConten

2015-12-15 00:30:10 7666

原创 [DP] Minimum Path Sum

Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either down or right at

2015-12-14 14:56:34 553

原创 Android之meta-data理解

android:resource="resource specification"           android:value="string" />是提供给父组件使用的任意数据类型的补充数据。可以嵌入在如下几种Component组件中:    在每种AndroidManifest的某个组件中申明时,其数量没有限制,最终都是保存在Bundle类型

2015-12-11 16:19:40 700

原创 byte[]和short[]

1. short[]  to  byte[]ByteBuffer buffer = ByteBuffer.allocate(shortArray.length * 2);buffer.order(ByteOrder.LITTLE_ENDIAN);buffer.asShortBuffer().put(shortArray);byte[] bytes = buffer.array();

2015-12-10 19:13:50 868

原创 [DP] Unique Paths

A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the

2015-12-10 14:51:20 925

原创 Android 连续点击back button退出当前Activity的两种实现方法

设定连续两次点击的时间差在2s内为有效。1. 通过辅助标志位和用sendEmptyMessageDelayed方法来进行更新的方式:private static boolean exited = false; mBackButton.setOnClickListener(new View.OnClickListener() { @Override

2015-12-09 19:03:55 3572

原创 Pow(x, n)

Implement pow(x, n).public class Solution { double myPow(double x, int n) { if(n==0) return 1; if(n<0){ n = -n; x = 1/x; } return n%2==0

2015-12-07 15:02:16 411

原创 [DP] Unique Binary Search Trees

Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique BST's. 1 3 3 2 1 \

2015-12-07 14:24:43 643

原创 长度为0的数组和 null

长度为0的数组 int[] arr = new int[0],也称为空数组,虽然arr长度为0,但是依然是一个对象null数组,int[] arr = null;arr是一个数组类型的空引用。1. 编写api方法,进行参数校验时,不要漏掉空数组的情况比如下面这个计算递增子序列最大长度的方法,要考虑空数组的情况。public class Solution { public i

2015-12-03 12:59:36 13293

html5与手机游戏的未来

大致简述html5和手机游戏开发的ppt

2012-04-05

空空如也

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

TA关注的人

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