原创 Android 使用ViewPager Indicator時,標題顯示不全的問題

原因其實很簡單,在style文件裏面會有一個風格設置: 只需把紅框內的paddingLeft和paddingRight改小即可,原先默認是22,所以文字過多的話就會不顯示。 如果還是顯示不全,就把字體縮小,應該就可以了。

原创 Android官方Training閱讀筆記 ---- Managing the Activity Lifecycle(Recreating an Activity) (四)

There are a few scenarios in which your activity is destroyed due to normal app behavior, such as when the user pr

原创 Android 關於頁卡布局的一個小技巧---如何在當前頁刷新數據

比如,app佈局有4個選項卡,在其中一個選項卡中點了按鈕,另外打開了一個Activity作了數據處理,當結束此Activity返回到之前的頁卡時,需要刷新下此頁卡和其他頁卡的數據內容,當然可以在onResume()裏面完成,不過我感覺比較

原创 Saving Data --- Saving Files(二)

Android uses a file system that’s similar to disk-based file systems on other platforms. This lesson describes how to

原创 Android官方Training閱讀筆記 ---- Building a Dynamic UI with Fragments(Building a Flexible UI) (二)

When designing your application to support a wide range of screen sizes, you can reuse your fragments in different lay

原创 Building a Dynamic UI with Fragments ---- Communicating with Other Fragme (三)

In order to reuse the Fragment UI components, you should build each as a completely self-contained, modular component

原创 Saving Data --- Saving Key-Value Sets(一)

Most Android apps need to save data, even if only to save information about the app state during onPause() so the user

原创 Android官方Training閱讀筆記 ---- Building a Dynamic UI with Fragments(Creating a Fragment) (一)

To create a dynamic and multi-pane user interface on Android, you need to encapsulate UI components and activity behav

原创 Android 使用OKhttp 3.0以上版本上傳文件或圖片(MultipartBuilder已不可用)

okhttp不用說,很火的網絡庫。今天說一下上傳圖片的問題。 搜索一下,很有很多文章介紹怎樣上傳圖片,到本篇文章爲止我看到都是用的MultipartBuilder構造器,但是在3.0以上版本中MultipartBuilder已被替代,官方

原创 Android Studio每次重啓都恢復之前的狀態

前天很悲劇,把臺式機電源線給踢了,然後重啓電腦打開AS後就發現工作狀態回到最初始的狀態,關閉時的文件、目錄結構、過濾條件、底部欄位置都被歸置了,然後關閉,再打開,還是一樣。。。。。 其實引起這種情況的原因是工程目錄下的.idea—->l

原创 Android NullPointerException at android.text.BoringLayout.isBoring

最近遇到個很奇怪的問題,如題,下面是詳細報錯信息: E/AndroidRuntime: FATAL EXCEPTION: main java.lang.NullPointerException

原创 Andorid 方法數超過64K的問題

其實早就聽過64K這個問題,只是覺得目前所做的項目較小,應該不會有這個問題。出現這個問題的直接原因我覺得應該是集成進了高德地圖的三個jar包:309KB、377KB、474KB。然後的某天突然就提示64K的問題了,最開始我把無用的jar包

原创 Litepal創建表時報錯 an exception that indicates there was an error with sql parsing or execution

原因很簡單:實體類中的變量用了SQL語法中的關鍵字,所以在創建表的時候會報錯,,,,,,

原创 android使用zxing掃描界面全是白色以及更改顯示文字屏幕居中

二維碼掃描程序使用了夏神的項目,並作了修改及完善: 1.掃描圖片有拉伸 2.掃描界面全部呈現白色 3.提示信息在屏幕水平居中 一、圖片有拉伸 解決辦法:在CameraConfigurationManager類裏面的initFromCam

原创 RxJava 學習筆記

扔物線文章 《給 Android 開發者的 RxJava 詳解》 的學習筆記。 RxJava 介紹 Github 地址: https://github.com/ReactiveX/RxJava https://github.co