1
Couldn’t resolve resource @color/title_color (58 similar errors not shown)
解決辦法
重啟:File -> Invalidate Caches / Restart… -> Invalidate and Restart
2
footView = LayoutInflater.from(mContext).inflate(R.layout.list_account_footer, null);
dialogView = LayoutInflater.from(mContext).inflate(R.layout.dialog_add_account, null);
第一行沒問題,第二行報空指針
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
原因及解決辦法 此處的View是V小寫的 改成大寫V
<view style="@style/Line_View" android:layout_height="1dp"/>
3
一直認為Java代碼順序執行,然而在寫登錄頁面,判斷手機號是否為空(寫在方法里進行調用),寫成一方法,結果程序運行結果跳過了這些判斷先進性調用登錄接口,莫名的無語。
解決辦法
這些判斷語句不要抽出方法,而是在方法里一次寫語句,進行判斷。
4
在使用viewpager時The specified child already has a parent. You must call rem
viewpager默認加載3頁
我在進行無限循環(設置了加大量 list.size()*1000000),當list只有1或2或3頁數據時,會報如上錯誤。
解決辦法將list進行復制翻倍使得其數量>3