Attempt to invoke virtual method 'void android.app.ActionBar.setTitle的解決方法


在安卓4.4.2的關於藍牙開發的一個sample BluetoothChat中,調試時,老是出錯:Attempt to invoke virtual method 'void android.app.ActionBar.setTitle

上網查了一下,是這么說的:

     (http://www.tuicool.com/articles/IRzUR3M)

The LayoutManager is probably the most interesting part of theRecyclerView . This class is responsible for layouting all child views. There isone default implementation available: LinearLayoutManager which you can use for vertical as well as horizontal lists.

You have to set a LayoutManager for your RecyclerView otherwise you will see an exception at Runtime:

所以我就把源代碼中的:

private final void setStatus(int resId)

private final void setStatus(CharSequence subTitle)

這兩個方法注釋掉,就可以正常運行了。




免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM