自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(21)
  • 收藏
  • 关注

转载 开启Android程序时检测网络与GPS是否打开

1.网络是否连接(包括Wifi和移动网络)[javascript] view plaincopyprint?// 是否有可用网络      private boolean isNetworkConnected() {          ConnectivityManager cm =                   (Conn

2014-05-03 12:29:40 477

转载 Android 常用RGB值以及中英文名称

Android   常用RGB值以及中英文名称 颜  色   RGB值英文名中文名 #FFB6C1LightPink浅粉红 #FFC0CBPink粉红 #DC143CCrimson深红/猩红 #FFF0F5LavenderB

2014-04-08 00:14:29 458

原创 leetcode 难题 Unique Binary Search Trees

Unique Binary Search Trees Total Accepted: 11242 Total Submissions: 31688My SubmissionsGiven n, how many structurally unique BST's (binary search trees) that store values 1...n?For exa

2014-04-06 00:32:33 339

原创 leetcode 难题 Best time to buy and sell stock III

Best Time to Buy and Sell Stock III Total Accepted: 6858 Total Submissions: 31575My SubmissionsSay you have an array for which the ith element is the price of a given stock on day i.De

2014-04-05 12:18:26 593

原创 leetcode-Best Time to Buy and Sell Stock I II

public class Solution {    public int maxProfit(int[] prices) {        int x;        int profit=0;        for(x=0;x            int p = prices[x+1]-prices[x];            if (p>0){       

2014-04-04 13:20:03 514

原创 leetcode-reverse words in a string

Reverse Words in a String Total Accepted: 6674 Total Submissions: 47976My SubmissionsGiven an input string, reverse the string word by word.For example,Given s = "the sky is blue",

2014-04-04 10:20:29 452

原创 leetcode 简单题 Maximum Depth of Binary Tree and so on

Maximum Depth of Binary Tree Total Accepted: 13959 Total Submissions: 32009My SubmissionsGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes alon

2014-04-03 22:41:06 512

转载 leetcode-Climbing Stairs

You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?Easy solutions f

2014-04-03 13:42:01 441

转载 LeetCode Single Number I & II 都符合两个问题额外要求的 通用解法 与 思考过程

LeetCode Single Number I & II 都符合两个问题额外要求的 通用解法 与 思考过程2013-11-02 08:07:03     我来说两句       作者:靖心收藏    我要投稿Single NumberGiven an array of integers, every element appears twice except for

2014-04-03 13:04:51 715

转载 int与Integer的区别 互转

int 是基本数据类型Integer是其包装类,注意是一个类。为什么要提供包装类呢???一是为了在各种类型间转化,通过各种方法的调用。否则 你无法直接通过变量转化。比如,现在int要转为Stringint a=0;String result=Integer.toString(a);在java中包装类,比较多的用途是用在于各种数据类型的转化中。我写几个demo//通过包装类来实现

2014-04-03 12:53:15 883

转载 通过ContactsContract类获取电话号码的改变

Java代码  String string = "";  super.onCreate(savedInstanceState);  ContentResolver cr = getContentResolver();  Cursor cursor = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, 

2014-03-31 06:20:52 668

转载 Android学习记录(2)—Android中数据库的常见操作

android中数据库操作是非常常见了,我们会经常用到,操作的方法也有很多种形式,这里我就把最常见的两种形式记录下来了,以备以后用到方便查看。我就不写注释和解释了,因为android数据库的操作和其它数据库操作本质上都是一样的,大同小异。需要的一些基本解释都在代码中,直接上代码了。   简单的代码文件目录:首先这个类是数据库帮助类,DBHelper.java,代码如下:

2014-03-30 20:46:36 556

转载 leetcode JAVA Reverse Words in a String 难度系数2-3?最新题151

本来用了string的split,写完发现二了,没有办法切割多个空格的情况,如果想切割多个空格,那就一定要带上正则表达式了。于是老老实实的从尾遍历到头。好吧,上代码:Reverse Words in a StringGiven an input string, reverse the string word by word.For example,G

2014-03-30 11:38:19 667

转载 Android 高手进阶教程(十三)之----Android 数据库SQLiteDatabase的使用!!

大家好,好久没有更新博客了,最近由于身体不适让大家久等了,好了,直接进入主题~Android 提供了三种数据存储方式,第一种是文件存储;第二种是SharedPreferences 存储;第三种就是数据库SQLiteDatabase 存储。文件存储我就不用多说了,而SharedPreferences 可以存取简单的数据(int,double,float.etc),它经常用于数据缓存,

2014-03-22 12:19:48 401

转载 消息模式Toast.makeText的几种常见用法

转载自:http://daikainan.iteye.com/blog/1405575Toast 是一个 View 视图,快速的为用户显示少量的信息。 Toast 在应用程序上浮动显示信息给用户,它永远不会获得焦点,不影响用户的输入等操作,主要用于 一些帮助 / 提示。Toast 最常见的创建方式是使用静态方法 Toast.makeText我使用的是 SDK 2.2

2014-03-22 12:06:47 403 1

转载 Android应用中使用及实现系统“分享”

When viewing the details of any location in Google Maps, there's an option for "Share this place". I have successfully added myself to the list of receivers by adding this intent-filter to my applicat

2014-03-21 13:36:27 463

转载 java interface 用法

import java . io . * ; import java . util . * ; import java . util . regex . * ; interface myinterface{         public void output ( ) ; } public class tmp implements myinterface{ 

2014-03-18 04:43:46 586

转载 android中The connection to adb is down,问题和解决

1.报错: BUILD FAILED D:\workspace\ganji\build.xml:144: The following error occurred while executing this line: D:\workspace\ganji\build.xml:271: Unable to delete file D:\workspace\ganji\tmp\progua

2014-03-14 04:58:11 395

转载 putExtra putExtras 小结

存 intent.putExtra("age", 21); 取 int age = intent.getIntExtra("age",-1); // -1为默认值 取不到就赋值-1存 bundle.putParcelable("Create key", t);   intent.putExtras(bundle);取   一 Parcelable parcelabl

2014-03-14 00:09:39 2086

转载 Android进阶2之Activity之间数据交流(onActivityResult的用法)

主要功能:在一个主界面(主Activity)上能连接往许多不同子功能模块(子Activity上去),当子模块的事情做完之后就回到主界面,或许还同时返回一些子模块完成的数据交给主Activity处理。这样的数据交流就要用到回调函数onActivityResult。startActivityForResult(Intent intent, int requestCode);

2014-03-12 04:17:20 549

转载 Android高手进阶教程(十七)之---Android中Intent传递对象的两种方法(Serializable,Parcelable)!

大家好,好久不见,今天要给大家讲一下Android中Intent中如何传递对象,就我目前所知道的有两种方法,一种是Bundle.putSerializable(Key,Object);另一种是Bundle.putParcelable(Key, Object);当然这些Object是有一定的条件的,前者是实现了Serializable接口,而后者是实现了Parcelable接口,为了让大家更容易理解

2014-03-12 04:14:48 351

空空如也

空空如也

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

TA关注的人

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