Time of Update: 2015-07-22
標籤:service生命週期本節學習Service的生命週期。
Time of Update: 2015-07-22
標籤:android今天在閱讀代碼發現了android Handlerr.removeCallbacksAndMessages(null)代碼 在ondestory()調用,之前沒用過,那想弄懂咋辦,查api:public final void removeCallbacksAndMessages (Object token)Added in API level 1Remove any pending posts of callbacks
Time of Update: 2015-07-22
標籤:adapter listview
Time of Update: 2015-07-22
標籤:這道題以前寫過,bfs,用隊列,不多說了,上代碼:#include<stdio.h>#include<stdlib.h>#include<string.h>#include<queue>using namespace std;int map[10][10];int visit[10][10];int dist[10][10];int dx[8]={-2,-2,-1,-1,1,1,2,2};int dy[8]={-1,1,-2,2,-2,2,-
Time of Update: 2015-07-22
標籤:gradle dsl android may be missing a gra gradle dsl method no 原文錯誤提示:Error:(16, 0) Gradle DSL method not found: ‘android()‘Possible causes:<ul><li>The project ‘XXXXXXX‘
Time of Update: 2015-07-22
標籤:1. 在res目錄下的drawable目錄下建立shape.xml檔案<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <!-- 填充的顏色 -->
Time of Update: 2015-07-22
標籤:android jni c語言 轉載請註明出處:http://blog.csdn.net/l1028386804/article/details/470022071、將java字串轉化為c++字串/** *工具方法 *將java字串轉化為c++字串 *返回字串數組的首地址 */char* Jstring2CPPStr(JNIEnv* env, jstring jstr,
Time of Update: 2015-07-22
標籤:jquery 驗證碼 簡訊 倒計時 //傳送簡訊驗證碼 $(":button.getcode").click(function(){ var reg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
Time of Update: 2015-07-22
標籤:有時候真想吐槽下OC,但是沒有資格,畢竟不是靠這個吃飯的。用html5寫了一個郵件功能,沒有問題,但是附件的地方出現了問題,PC瀏覽器上面點選連結是下載,移動端用iframe就可以直接開啟預覽,好的問題來了。第一個問題,開啟excel很容易卡死,直接無法解析出來。第二個問題,開啟txt亂碼,已經知道txt的編碼是GBK2132,需要重新編碼,但是問題是我沒有下載到本機怎麼重新編碼了。第三個問題,也是最奇葩的問題,開啟pdf沒有問題,但是返回來後html5的header不見了,
Time of Update: 2015-07-22
標籤:在開發Android的時候,很多時候我們需要知道應用頁面是否還處在螢幕,如果不在螢幕了,我們需要做一些背景服務,啟動service等。這時,我們就需要進行判斷,但是怎麼才能知道呢,Android為我們提供了activityManager來擷取應用集合,當我們想判斷我們應用是否還在第一個,我們就需要對應用集合遍曆。private boolean isForeground() { List<RunningAppProcessInfo> appProcesses =
Time of Update: 2015-07-22
標籤:app效能分析 效能分析 解決方案 蘋果app的流暢性一般比安卓的要好的多,應該是和蘋果系統的設計理念相同,早期的iphone4以前是絕對單任務,只能做一件事情,雖然增加了後台可以,音樂播放,定位等有限的服務,但是大多數普通應用程式切換到後台就別掛起,直到被系統殺死(10--15分鐘)。一個任務當然記憶體利用率和cpu調度管理就要好管理多了,效率也高。app也不作為伺服器,也不存在超多個s
Time of Update: 2015-07-22
標籤:壓縮 圖片 bitmapfactory 1、BitmapFactory.Options中的屬性在進行圖片壓縮時,是通過設定BitmapFactory.Options的一些值來改變圖片的屬性的,下面我們來看看BitmapFactory.Options中常用的屬性意思:options.inPreferredConfig -
Time of Update: 2015-07-22
標籤:Android中建立捷徑主要有兩種方式,一是在代碼中直接添加產生案頭捷徑的代碼;二是通過小組件添加;這篇文章主要講第二種方法!1、通過在AndroidManifest檔案中為Activity添加<intent-filter> <action android:name="android.intent.action.CREATE_SHORTCUT"/>
Time of Update: 2015-07-22
標籤:android-studio1,在build.grandle添加,其中規則寫在proguard-rules.pro中,也可以自訂一個檔案,將其代替,比如eclipse常用的 proguard-project.txtbuildTypes { release { signingConfig signingConfigs.release minifyEnabled true proguardFiles
Time of Update: 2015-07-22
標籤: ** 類型,指標的指標,是一個很古老的 C 語言的技巧 用處:一個方法,可以返回多個數值 NULL & nil 有什麼區別 - NULL 是 C 的,空地址,數字,本身的數值是 0 不能給 NULL 訊息 - nil nil 是 OC 的,nil
Time of Update: 2015-07-22
標籤:File這是檔案基類,抽象地代表一個檔案實體,它有四個不同的構造方法: File(File dir, String name) File(String path) File(String dirPath, String name) File(URI
Time of Update: 2015-07-22
標籤:block 分為三種 NSGlobalBlock,NSStackBlock,
Time of Update: 2015-07-22
標籤://// zyAppDelegate.h// XX//// Created by nimami on 15/7/22.// Copyright (c) 2015年 lkl. All rights reserved.// #import <UIKit/UIKit.h> @interface zyAppDelegate : UIResponder
Time of Update: 2015-07-22
標籤:<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="viewport"
Time of Update: 2015-07-22
標籤:MainActivity如下:package com.testnbackpressed; import android.os.Bundle; import android.view.KeyEvent; import android.app.Activity; /** * Demo描述: * 處理Back鍵按下事件 * * 注意事項: * 以下兩種方法勿一起使用 */ public class MainActivity extends Activity {