Time of Update: 2013-12-11
要實現電話監聽,需要監聽電話的狀態,方法如下. ListenReceiver類: 收到電話廣播時開啟監聽電話的服務public class ListenReceiver extends BroadcastReceiver { public void onReceive(Context context, Intent intent) {
Time of Update: 2013-12-11
在Android應用開發中,很多時候都會遇到這樣的需求,一個listView,含有N項,當點擊某項時,該項展開,顯示該項中隱藏的某些控制項,再點擊,該項收回,重新隱藏部分控制項,當一項開啟狀態,點擊另一項,另一項展開,該項關閉。(說的有點繞,看) 在去年的時候,自己的一篇文章(http://blog.csdn.net/aomandeshangxiao/article/details/6643831),
Time of Update: 2013-12-11
在Item的布局中設定布局的背景為圖片動態引用即可:applist_view.xml[html]<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width=&
Time of Update: 2013-12-11
1.第一種方法private void toggleGPS() { Intent gpsIntent = new Intent();
Time of Update: 2013-12-11
先上,有圖有真相:自訂RelativeLayout[java]package com.demo.softkeyboard; import android.content.Context; import android.util.AttributeSet; import android.widget.RelativeLayout; public class KeyboardListenRelativeLayout extends
Time of Update: 2013-12-11
Android UI預設的標題列由android:label 定義,顯示在螢幕左上方,Android允許Activity自訂標題列,使用自訂Layout重新設定標題列,比如實現Windows Mobile 風格的標題列。App->Activity->Custom Title
Time of Update: 2013-12-11
Reorder Activities 樣本有四個相關的Activitives: ReorderOnLaunch, ReorderTwo,ReorderThree, ReorderFour。其中ReorderOnLaunch為主Activity,ReorderOnLaunch啟動ReorderTwo ,ReorderTwo啟動 ReorderThree,ReorderThree啟動 ReorderFour。 這時在Activity的”back
Time of Update: 2013-12-11
Android初始化語言 (init.*.rc、init.conf檔案格式) Android初始化語言套件含了四種類型的聲明:Actions (行動)、Commands (命令)、Services (服務)和Options (選項)。 所有這些都是以行為單位的,各種記號由空格來隔開。C語言風格的反斜線號可用於在記號間插入空格。雙引號也可用於防止字串被空格分割成多個記
Time of Update: 2013-12-11
這個例子的Icons Only 和 Icons and marquee 沒有什麼特別好說明的。而Use Remote views in balloon 介紹了可以自訂在Extended Status bar顯示Notification的Layout,Extended Status Bar預設顯示Notification 是一個表徵圖後接文字,對應大多數情況是夠用了。但如果有需要也可以使用自訂的Layout在Extented Status
Time of Update: 2013-12-11
1.報錯:BUILD FAILEDD:\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\proguard\tmp.jar解決:已經開了一個模擬器了,無法重新編譯,必須關閉一個。用於ant2.報錯:The
Time of Update: 2013-12-11
Android SDK對應沒個定義在res目錄下的資源都會定義一個維一的資源ID。在編譯時間會在gen目錄下產生 R.java , 資源ID的格式為 R.[type].[id] 類型為資源類型如anim, array, attr等 可以在代碼或是XML資源檔(如layout, style中)訪問這些資源。Context類提供了訪問資源的方法,一是直接通過如getText,
Time of Update: 2013-12-11
對於ViewGroups物件版面配置變化的動畫屬性動畫系統給ViewGroup對象的動畫變化提供了與View對象一樣容易動畫處理方法。使用LayoutTransition類在ViewGroup內部處理布局變化的動畫。當調用一個View對象的setVisibility()方法,或者設定該View的GONE常量,或者把該View對象添加到ViewGroup中(或者從ViewGroup中刪除)時,在ViewGroup內部的View對象就能夠實現時隱時現的動畫效果。當在ViewGroup對象中添加或刪除
Time of Update: 2013-12-11
A.根據官方的開發指南,所有的程式與以下服務或者系統組件相關聯1.Views 程式的視圖.直接與程式使用者接觸,提供互動.2.Content
Time of Update: 2013-12-11
本例使用一個自訂的TextView,每隔1秒顯示目前時間。前定義如下:[java]//--------------------------------- PACKAGE ------------------------------------ package com.pstreets.guice.customview; //--------------------------------- IMPORTS -----------------
Time of Update: 2013-12-11
首先我們來看下源碼中源於Activity的定義:[java] public class Activity extends ContextThemeWrapper implements LayoutInflater.Factory2, Window.Callback,
Time of Update: 2013-12-11
android.nio 包中定義裡Buffer和類型相關的子類: Buffer類功能類似於數組,它定義了一些用於管理和服務數組中元素的方法。Bitmap類中定義的方法public void copyPixelsFromBuffer(Buffer src)和 public void copyPixelsToBuffer(Buffer dst) 可以用來實現Bitmap 的像素數組與Buffer直接的資料交換。和Bitmap的public void getPixels(int[]
Time of Update: 2013-12-11
[故事概要] 今天調查一個線上Bug。 產品本身是一個Android 應用。 已APK的方式安裝和運行在Android裝置上。整體的架構是naive 開發搭架構,中間嵌入WebView。這些都沒什麼好說的。
Time of Update: 2013-12-11
繪圖動畫會讓你依次的載入一系列的繪圖資源來建立一個動畫。這種動畫是一種傳統動畫,它是用不同的圖片序列來建立並依次播放的,看上去像放電影。AnimationDrawable類是繪圖動畫的基類。你能夠使用AnimationDrawable類的API在代碼中定義動畫的幀,但是,用一個單獨的定義了組成動畫幀的列表的XML來完成動畫會更加簡單。這種類型動畫的XML檔案要放在你的Android工程的res/drawable/目錄中。這種情況下,指令是動畫的播放順序和每一幀動畫的播放時間。這個動畫XML檔案是
Time of Update: 2013-12-11
除了在XML中使用Shape Drawable 資源外(如上例),也可以使用代碼來定義Shape Drawable,為Android中定義的Shape 類層次圖: 如果熟悉二維圖形開發,Path, Arc, Rect, Oval, RoundRect應該不陌生。 本例ShapeDrawable使用代碼來建立各種ShapeDrawable 並自訂一個Shape :MyShapeDrawable.Android 中的 Shader 類同於其它平台的畫刷Brush
Time of Update: 2013-12-11
貌似沒什麼用的軟體盤彈出的功能,利用pg怎麼去實現,純屬娛樂1.首先是phonegap必備的兩個檔案,分別是本地.java代碼SoftKeyBoard.java[java] package com.tricedesigns; import org.json.JSONArray; import android.content.Context; import