2014年9月19日 星期五

[Android] Notifications 訊息通知/狀態列顯示通知


因為專題需要用到這個功能,所以上網查找了下使用方法
意外發現有三種:
Notification
Notification.Builder
NotificationCompat.Builder

若依照現今API舊版到新版寫法就是:
Notification (API 11以下適用)
NotificationCompat.Builder (相容性寫法/折衷)
Notification.Builder (API 16 以上適用)

這篇文章將以NotificationCompat.Builder為準--

2014年7月29日 星期二

[Error]Found 2 versions of android-support-v4.jar in the dependency list

Found 2 versions of android-support-v4.jar in the dependency list,
but not all the versions are identical
(check is based on SHA-1 only at thistime).
All versions of the libraries must be the same at this time.

Versions found are:

Path: C:\work\Test\libs\
        android-support-v4.jar
        Length: 385685
        SHA-1: 48c94ae70fa65718b382098237806a5909bb096e

Path:
C:\work\Chat\libs\
        android-support-v4.jar
        Length: 349252
        SHA-1: 612846c9857077a039b533718f72db3bc041d389

Jar mismatch! Fix your dependencies

2014年7月6日 星期日

[Error] The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments

出現在程式碼內的錯誤
xxx.setOnClickListener(this);

手機上執行後會出現
The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments
的錯誤訊息

[Error] the import android.support.v7.app cannot be resolved

有時候在新增一個Android專案後會出現類似的問題
the import android.support.v7.app cannot be resolved