原创 SlidingMenu測拉布局使用詳解

將SlidingMenu整合到自己的項目之中     我們在使用開源的項目之前,都需要先將項目作爲資源引入到我們當前的項目之中。在整合之前,先將github上項目的示例代碼下載下來,導入到eclipse當中。關於將外部項目導入當前項目,

原创 EditText中android:inputType屬性的作用

設置文本的類型,用於幫助輸入法顯示合適的鍵盤類型。有如下值設置:none、text、textCapCharacters字母大小、textCapWords單詞首字母大小、textCapSentences僅第一個字母大小、textAutoCo

原创 VideoView申請音頻焦點問題

問題現象:使用VideoView寫了一個懸浮框播放視頻程序,在懸浮框代碼中註冊音頻焦點監聽事件,監聽懸浮框的音頻焦點獲取和丟失。發現懸浮框和Music同時播放了。 分析:通過log分析當時音頻焦點的獲取情況,如下: I/Medi

原创 配置文件 標籤警告

Not targeting the latest versions of Android; compatibility modes apply. C

原创 在用eclipse時出現 Several ports (8080, 8080)

Several ports (8080, 8080) required by Tomcat v6.0 Server at localhost are already in use. The server may already be ru

原创 [Accessibility] Missing contentDescription attribute on image

碰到標題提示的警告,一般是用到了ImageView 標籤,就是提示你要給它增加一個說明,那你就按照他的提示,添加一個contentDescription 屬性就好了,代碼如下:android:contentDescription="@st

原创 Button cannot be resolved to a type 解決方法

Button button = (Button)this.findViewById(R.id.button); 書寫上句話時候總是報錯Button cannot be resolved to a type,import android.w

原创 Android分辨率中dip, dp, px, sp之間的區別

dip: device independent pixels(設備獨立像素). 不同設備有不同的顯示效果,這個和設備硬件有關,一般我們爲了支持WVGA、HVGA和QVGA 推薦使用這個,不依賴像素。  px: pixels(像素). 不

原创 android SD卡路徑問題以及如何獲取SDCard 內存 (轉)

SD卡路徑問題以及如何獲取SDCard 內存昨天在研究拍照後突破的存儲路徑的問題,開始存儲路徑寫死爲: private String folder = "/sdcard/DCIM/Camera/"(SD卡上拍照程序的圖片存儲路徑); 後來

原创 void android.app.Activity.overridePendingTransition(int enterAnim, int exitAnim) 的使用

  function : 如果你顯示的調用了這個方法,當startActivity(Intent) 或是 finish方法執行時,會立即調用,並執行明確的transaction動畫。       param1 :  載入動畫,anima

原创 Android學習錯誤處理

android的main.xml文件中編寫控件EditText時This text field does not specify an inputType or a hint 解決方法 你嘗試添加下面兩個屬性看看 android:hi

原创 Android中assets目錄和res/raw目錄的異同和使用場景

原文鏈接 好久沒寫些什麼了,一直比較忙,有近2個月沒更新博客了。 今天看到有人問Android中assets目錄和raw目錄的區別和使用情況。 能提出這個問題的,應該都瞭解它們的共同點: 它們會被原封不動的拷貝到APK中,而不會