原创 關於butterknife的理解

butterknife在AndroidStudio中可以說是一個很方便的工具,他的用途和用法也都很簡單。 1.用途 常用的用途簡單來說有三點: 1)用於生成findviewbyid。 2)用於生成viewholder。 3)用於生

原创 Android 在一個activity中關閉其他activity

1、問題:從ActivityA跳轉到ActivityB,再從ActivityB跳轉到ActivityC,在第二次跳轉時既要關閉ActivityB也要關閉ActivityA,要怎麼做到? 1)首先,在ActivityA中定義一個變量

原创 常用的實用工具jar包導入

dependencies {     compile fileTree(dir: 'libs', include: ['*.jar'])     testCompile 'junit:junit:4.12

原创 修改menu字體顏色

在theme中加入這一行 <item name="actionMenuTextColor">@color/text_color</item>

原创 colorPrimary、colorPrimaryDark、colorAccent

colorPrimary—導航欄顏色 colorPrimaryDark—通知欄顏色 colorAccent—控件選中後顏色

原创 Android錄製或播放語音消息時關閉其他媒體播放

1.發送系統廣播: Intent i = new Intent(“com.android.music.musicservicecommand”); i.putExtra(“command”, “pau

原创 android問題記錄IndexNotReadyException

1.報出問題: Please change caller according to com.intellij.openapi.project. IndexNotReadyException documentation 2.分析問題

原创 Android如何在退出App時關閉整個應用程序

第一步:在基類中定義一個靜態變量 public static boolean exit=false; 第二步:在基類中的onRestart方法裏添加 if(App.exit){finish();} 第三步:在你要退出activit

原创 Sourcetree安裝及使用注意事項

Sourcetree安裝及使用注意事項 1.      安裝第二步,需要翻牆,使用google或atlassian賬號登錄,網速慢請耐心等待驗證碼出現,可用lan燈或者loco。下一步有時會有稍許延遲,耐心等待 2.      使用前注意