在安卓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)
這兩個方法注釋掉,就可以正常運行了。