Time of Update: 2013-12-11
文法(SYNTAX):<categoryandroid:name="string"/>包含於(CONTAINED
Time of Update: 2013-12-11
private DisplayMetrics dm;//螢幕解析度容器 dm = new DisplayMetrics(); this.getWindowManager().getDefaultDisplay().getMetrics(dm); int width = dm.widthPixels; int height = dm.heightPixels; Display display = getWindowManager().getDefaultDisplay();int
Time of Update: 2013-12-11
文法(SYNTAX):<grant-uri-permissionandroid:path="string" android:pathPattern="string" &
Time of Update: 2013-12-11
Understanding AsyncTaskAsyncTask是Android 1.5 Cubake加入的用於實現非同步作業的一個類,在此之前只能用Java SE庫中的Thread來實現多線程非同步,AsyncTask是Android平台自己的非同步工具,融入了Android平台的特性,讓非同步作業更加的安全,方便和實用。實質上它也是對Java
Time of Update: 2013-12-11
以前在做iOS項目的時候,UI操作是不允許寫在子線程當中的,不然會出異常。那麼Android中是不是這樣呢?答案:是的! 你可以把某個UI操作( 比如:textView.setText("123")
Time of Update: 2013-12-11
一、只想讓TextView顯示一行,但是文字超過TextView的長度怎麼辦?在開頭顯示省略符號[html]
Time of Update: 2013-12-11
文法(SYNTAX):<serviceandroid:enabled=["true" | "false"] android:exported=["true" | "false"]
Time of Update: 2013-12-11
說一下自己關於SurfaceView的一點感受:(1.)定義: 可以直接從記憶體或者DMA等硬體介面取得映像資料,是個非常重要的繪圖容器。 它的特性:可以在主線程之外的線程中向螢幕繪圖上。這樣可以避免畫圖任務繁重時造成主線程阻塞,從而提高了程式的反應速度。在遊戲開發中多用到SurfaceView,遊戲中的背景、人物、動畫等等盡量在畫布canvas中畫出。
Time of Update: 2013-12-11
sensorMgr = (SensorManager) getSystemService(SENSOR_SERVICE); SensorEventListener lsn = new SensorEventListener() { @Override public void onSensorChanged(SensorEvent e) { // TODO Auto-generated method
Time of Update: 2013-12-11
-------------------第一種,所有按鈕受監聽.package gongzibai.co.cc;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.TextView;import
Time of Update: 2013-12-11
在Android中顯示網頁主要有兩種方式,一種是在Activity裡面直接顯示網頁,另一種是呼叫瀏覽器顯示網頁。方式不同,使用的方法也不同,下面我們分別講解。(一)在Activity裡面直接顯示網頁1.在Manifest.xml檔案裡添加Inter網存取權限:<uses-permission
Time of Update: 2013-12-11
說到GridView Listview一定會提到他的adapter,現整理如下:main.xml布局裡面:[html] <GridView android:id="@+id/grid" android:layout_width="fill_parent"
Time of Update: 2013-12-11
方法1:按固定比例進行縮放在開發圖片瀏覽器等軟體是,很多時候要顯示圖片的縮圖,而一般情況下,我們要將圖片按照固定大小取縮圖,一般取縮圖的方法是使用BitmapFactory的decodeFile方法,然後通過傳遞進去
Time of Update: 2013-12-11
我們已經知道<intent-filter>用來定義你的Activity如何被另外的Activity開啟,這就是所謂的“過濾器”。但是,如果有兩個Activity有相同的<intent-filter>,那將發生什麼呢? AndroidManifest.xml中的代碼。 <?xml version="1.0"
Time of Update: 2013-12-11
到目前為止,想必大家已經都熟悉使用Toast去給使用者顯示資訊了。儘管使用Toast很方便,但是Toast顯示的通知並不是永久儲存的。它只在螢幕上顯示一小段時間,然後就消失了。如果它包含一些特別重要的資訊,如果使用者沒有觀察螢幕,那麼使用者就很容易錯過它。對於那些重要的資訊,應該採用一種更加持久儲存的方法。在這種情況下,應該使用NotificationMnanger(訊息管理器)去顯示一個長久的資訊,這個訊息被顯示在了StatusBar(狀態列)上面,使用使用者能夠很容易地看見。接下來展示如何發
Time of Update: 2013-12-11
使用AbsoluteLayout,可以指定它其中的子View的確切位置。觀察如下main.xml中的代碼: <?xml version="1.0" encoding="utf-8"?> <AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android" &
Time of Update: 2013-12-11
color theme是emacs的美化包.:http://www.nongnu.org/color-theme/linux下配置方法:將壓縮包中color-theme.el和themes檔案夾拷貝到某個檔案夾,我的是~/.emacs.d,然後開啟設定檔.emacs沒有.emacs可以點配置按鈕,然後點save for future sessions按鈕開啟後寫入:(add-to-list 'load-path "~/.emacs.d/")(require '
Time of Update: 2013-12-11
這應該是大部分Android開發人員在使用ListView時會碰到問題,在解決這個問題前,需要先瞭解什麼叫觸摸模式。觸摸模式(Touch Mode),在Android
Time of Update: 2013-12-11
一、DOM解析XML檔案[java] public static void main(String[] args) { File file = new File("d:\\WordChronos.xml"); DocumentBuilderFactory dbf =
Time of Update: 2013-12-11
import android.app.Activity;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.CompoundButton;import android.widget.CompoundButton.OnCheckedChangeListener;