(android problem)can't cast android.widget.linearlayout to android.widget.textview

其實是佈局的原因,改下佈局xml即可。網上搜了一下,有一位說的很到位。

It appears that you are passing in null as the root element of the view group. I would assume that the inflater is defaulting your view group to a linear layout, when you don't actually have a view group at all. I would try to modify your inflate call, as your layout file appears OK.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章