原创 eclipse的新字體導入

步驟: 1.當然是下載字體文件了 2.解壓文件獲取一個.ttf文件 3.將解壓獲取的.ttf文件拷貝到C:\WINDOWS\Fonts 文件夾下,字體會自動安裝。 4.eclipse中依次打開Window-->Preferences-->

原创 intent和intentFilter屬性詳解

Intent的Component屬性 Intent對象的setComponent(ComponentName comp)方法用於設置Intent的Component屬性. ComponentName包含如下幾個構造器: Componen

原创 android 點擊空白處隱藏軟鍵盤

</pre></div><pre name="code" class="java"> <pre name="code" class="java">實現點擊空白隱藏軟鍵盤有2種方式, 一、給佈局文件設置監聽器 二、使用android

原创 背景圖片不被拉伸的簡單解決方案

background會根據組件給定的長寬進行拉伸,而src就存放的是原圖的大小,不會進行拉伸。src是圖片內容(前景),bg是背景,可以同時使用。 可以使用xml src指定圖片,這樣圖片就不會根據view長寬進行拉伸了 代碼如下: <?

原创 ShapeDrawable用法詳解

Shape xml文件編寫方式 shape圖形屬性 corners 圓角效果 gradient 漸變效果 solid 填充色單一色 stroke 描邊 padding 空白 size shape的大小 Shap

原创 AnimationDrawable介紹及使用

http://blog.csdn.net/zqiang_55/article/details/8142785

原创 Calendar類的使用api介紹

Calendar類的使用api介紹: import java.text.DateFormat; import java.text.ParsePosition; import java.text.SimpleDateFormat; imp

原创 TransitionDrawable 使用詳解

transition 淡入淡出動畫 TransitionDrawable 對應的標籤爲 < transition> 用於實現兩個Drawable之間的淡入淡出。android:bottom , android:left, android

原创 BitmapFactory.Options 通過採樣率避免OOM

private static final String TAG = "ImageResizer"; public ImageResizer() { } public Bitmap decodeSampled

原创 android 硬件上的back鍵處理

在Activity中 重寫一下 onKeyDown事件: @Override public boolean onKeyDown(int keyCode,KeyEventevent) { //是否觸發按鍵爲back鍵

原创 Android SDK Timer的schedule()方法的正確使用

編寫一個定時器的時候回用到Timer類,其中方法schedule()方法參數詳細介紹如下 timer.schedule(new MyTask(),longtime1,long timer2); 這個方法有三個參數:  第一個參數,是

原创 InsetDrawable 內嵌式Drawable使用詳解

<?xml version="1.0" encoding="utf-8"?> <inset xmlns:android="http://schemas.android.com/apk/res/android" android:dr

原创 (一)AlarmManager使用與原理

鬧鐘原理 當鬧鐘響起,實際上是系統發出了爲這個鬧鐘註冊的廣播,會自動開啓目標應用。 註冊的鬧鐘在設備睡眠的時候仍然會保留,可以選擇性地設置是否喚醒設備,但是當設備關機和重啓後,鬧鐘將會被清除。 主要代碼介紹 一個鬧鐘的代碼編輯,核心使用

原创 BitmapDrawable 使用

BitmapDrawable 使用 目錄 BitmapDrawable 使用 目錄 BitmapDrawable 使用舉例 屬性詳解 BitmapDrawable 使用舉例 <?xml version="1.0" enc

原创 ListView OnItemClickListener點擊事件

轉載自:http://blog.csdn.net/catherine880619/article/details/6796561 public void onItemClick(AdapterView<?> parent, View