Time of Update: 2013-12-10
一、如何顯示assets/license.txt(中文)的內容?(1)方法1:InputStream.available()得到位元組數,然後一次讀取完。private String readUserAgreementFromAsset(String assetName) { String content
Time of Update: 2013-12-10
編譯時間的提示:Checking build tools versions…build/core/main.mk:165: ****************************************build/core/main.mk:166: * gcc is linked to llvm-gcc which will *build/core/main.mk:167: * not create a useable emulator. *build/core/main.mk:
Time of Update: 2013-12-10
今天看到有一個人寫的代碼,有幾個奇怪的方法。如下:public boolean onKeyDown(int keyCode, KeyEvent event) { // TODO Auto-generated method stub if (keyCode == KeyEvent.KEYCODE_BACK)
Time of Update: 2013-12-10
Service大全ACCESSIBILITY_SERVICE
Time of Update: 2013-12-10
4.0早就來了,但是大多機型還是2.x,並且tab形式的導航我個人感覺體驗很好。先看 這裡幾乎是和新浪微博的tab一模一樣,就是下面文字要稍稍高出一個像素,怎麼都調不好。 反編譯發現新浪微博的tab是用TabActivity來實現的。我個人是很不喜歡使用TabActivity的,主要是因為布局的根標籤必須是TabHost,甚至連id都給你指定好了。所以這裡選擇用ActivityGroup來做。
Time of Update: 2013-12-10
1. [代碼]php代碼 1 $array = array(2 'username'=>'楊鑄',3 'password'=>'123456',4 'user_id'=>15 );6 echo json_encode($array);2. [代碼]java代碼
Time of Update: 2013-12-10
總的頁面: 注意:按鈕間方法的改變需要: android:onClick="clearNoti" 添加相應的方法即可1.點擊狀態列按鈕時: public void Notification(View v){
Time of Update: 2013-12-10
題意就是給一個數,然後求這個數的所有因子中組成的最大的一個子集,其中1和本身除外,使得在這個子集中元素兩兩互素,求最大子集的元素個數,並且求出和最大的值。找規律就不難發現其實答案就是先大數分解n,例如,180=2^2*3^2*5,那麼就輸出3 18 ,這兩個數分別是素因子的個數和2^2,3^2,5的和。[cpp]#include <stdio.h> #include
Time of Update: 2013-12-10
A contextual menu offers actions that affect a specific item or context frame in the UI. You can provide a context menu for any view, but they are most often used for items in a ListView, GridView, or other view collections in which the user can
Time of Update: 2013-12-10
在Gallery下,裡面內容過長超出螢幕,這時我們可以用ScrollView來滾動,但是這樣做了以後,會發現一個問題,Gallery的滑動事件和ScrollView的滑動事件起衝突,這時我們可以自訂Gallery控制項來避免這個問題:下面貼出代碼:[java]import android.content.Context; import android.util.AttributeSet; import android.view.KeyEvent; import
Time of Update: 2013-12-10
首先是JAVA主代碼: package com.dudu.djy; import android.app.Activity; import android.os.Bundle; import android.os.Handler; import android.view.KeyEvent; import
Time of Update: 2013-12-10
當我們需要在整個應用程式中定義全域變數時,可通過擴充 Android 的 Application 類來實現,這裡是一個基礎的類用來操作全域的應用狀態。下面是建立全域變數的步驟:1) 建立一個新類擴充自 Application 類: public class Global extends Application { private Boolean _notification=false; public Boolean get_notification() {
Time of Update: 2013-12-10
public int nextInt()Returns a pseudo-random uniformly distributed int. 學過機率論和機率統計的應該都知道pseudo-random是偽隨機的意思,可是uniformly distributed是什麼意思呢?看一下《朗文當代進階英語詞典(英英、英漢雙解)第四版》中的解釋:uniform: adj(形容詞),being the same in all parts or among all its
Time of Update: 2013-12-10
下面實現本地代碼,再用ndk-build編譯產生.so庫檔案。由於編譯時間要用到make和gcc,這裡很多人是通過安裝cygwin,搭建一個linux環境編譯。我是直接用Android NDK裡ndk-build工具編譯,沒有安裝cygwin,也能編譯。一、編寫本地代碼fib.c首先在過程fiblib下建立一個目錄jni,將上一篇產生的jni標頭檔添加到這個目錄,接著在源碼目錄下建立檔案fib.c:檔案jni/fib.c: ?#include
Time of Update: 2013-12-10
/------------------------------------------------------------------------------------- // 作者:longtian635241(longtian_huang@urbetter.com) // 論壇ID:android210 Exynos4412 // 著作權:Tim // 平台:友堅android210 Exynos4412開發板 // 發布日期:
Time of Update: 2013-12-10
package cn.testreceiveshare1;import java.util.ArrayList;import android.net.Uri;import android.os.Bundle;import android.widget.ImageView;import android.widget.TextView;import android.app.Activity;import android.content.Intent;/** * Demo描述: *
Time of Update: 2013-12-10
Bitmap bit=Reflect3DImage.skewImage(bit, 50);package com.maxway.util; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.Camera; import android.graphics.Canvas; import
Time of Update: 2013-12-10
fillBefore是指動畫結束時畫面停留在此動畫的第一幀;fillAfter是指動畫結束是畫面停留在此動畫的最後一幀。java代碼設定如下:/*****動畫結束時,停留在最後一幀*********setFillAfter(true);setFillBefore(false); /*****動畫結束時,停留在第一幀*********setFillAfter(false);setFillBefore(true); xml設定如下:/*****
Time of Update: 2013-12-10
import android.annotation.SuppressLint;import android.content.Context;import android.view.View;import android.widget.Toast;public class ToastUtil {private static Toast toast;private static View view;private ToastUtil()
Time of Update: 2013-12-10
<!-- android:shadowDx 陰影的水平位移量 即往右移的距離 --> <!-- android:shadowDy 陰影的垂直位移量 即往下移的距離--> <!-- android:shadowColor 陰影顏色 --> <!-- android:shadowRadius 陰影的範圍 即陰影透明和擴散的程度--> <style name="textViewStyle">